-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Validation always fails on encrypted custom fields #9511
Description
Please confirm you have done the following before posting your bug report:
- I have enabled debug mode
- I have read checked the Common Issues page
Describe the bug
Validation always fail on custom fields that are encrypted on database.
I have tested using the NUMERIC and CUSTOM REGEX formats: both are failing (maybe also other formats are affected).
Also an empty value is not accepted.
To Reproduce
Steps to reproduce the behavior:
- go to 'Manage Custom Fields'
- click on the 'New Custom Field' button
- set 'test' as Field Name and 'Text Box' as Field Element
- choose NUMERIC as Format (or any other format but ANY)
- enable the Encrypt the value of this field in the database option
- click on 'Save'
- add the new field to an existing Fieldset (or create one ad-hoc) - do not flag it as 'Required'
- make sure the Fieldset is applied to some Asset Model (so the 'test' field is applied)
- create a new asset of a model matching the above Fieldset
- write '123' on the 'test' field value (or any other number, or leave it empty)
- fill in other required fields
- click 'Save'
- see the error
The test 3 must be a number.
Expected behavior
The value for the 'test' custom field should be accepted as valid.
The same should happen when no value is provided.
Screenshots
Validation fails on the 'test' field (encrypted), while is successful on the other non-encrypted field.
Both fields are configured as NUMERIC format.

Server (please complete the following information):
- Snipe-IT Version: 5.1.5 (docker official image)
Desktop (please complete the following information):
- OS: Windows
- Browser: Chrome
- Version: 87
Smartphone (please complete the following information):
n/a
Error Messages
- no errors appear on the phpdebugbar
- no errors appear in browser's error console
- the error is reproducible on the demo: https://snipeitapp.com/demo.
- no entries appear on docker container's logs
Additional context
- Server has been upgraded, but the error was present also on the previous version (5.1.4)
- the server is deployed using the official docker image
- no errors so far
- no manually edited data directly in the database
Metadata
Metadata
Assignees
Labels
Type
Projects
Status