Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom field type of CUSTOM REGEX defaults back to ANY on editing #11682

Closed
2 tasks done
mattcarras opened this issue Aug 15, 2022 · 0 comments
Closed
2 tasks done

Custom field type of CUSTOM REGEX defaults back to ANY on editing #11682

mattcarras opened this issue Aug 15, 2022 · 0 comments
Assignees

Comments

@mattcarras
Copy link

Debug mode

Describe the bug

Custom field type of CUSTOM REGEX defaults back to ANY on editing. If you then save the field again without re-selecting "CUSTOM REGEX", the custom format is overwritten by the default value used by ANY.

I'm new to Laravel, but I don't see where in the blade template or the composer it takes into account this->format not being in Helper::PREDEFINED_FORMATS for the select's default value, which appears to map both "ANY" and "CUSTOM REGEX" to the same blank value. I noticed there's a "getFormatType()" function that does return "CUSTOM REGEX" but I don't see where that's referenced anywhere.

This occurs on both the live demo and the current hosted version.

Also see previously submitted issues:
#5896
#7074
#8394

Reproduction steps

  1. Create new custom field.
  2. Set custom field type to CUSTOM REGEX.
  3. Add valid custom regex starting with "regex".
  4. Save custom field.
  5. Select to edit newly created custom field.
  6. Note custom field now has type of ANY.
  7. Save custom field.
  8. Select to edit custom field again.
  9. Change type from ANY to CUSTOM REGEX.
  10. Note custom format is now missing.
    ...

Expected behavior

Editing a custom field with custom regex should not default back to type of ANY.

Screenshots

No response

Snipe-IT Version

6.0.9

Operating System

Linux

Web Server

Whatever the demo uses

PHP Version

Whatever the demo uses

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants