Snipe-IT Version
develop d33c59c (our test instance); these code paths are unchanged on current develop (7fe44cd)
PHP Version
8.3.6
Composer Version
2.7.1
MySQL/MariaDB version
MariaDB 10.11.14
How did you install Snipe-IT?
Git install
Is this a fresh install or an upgrade?
Fresh install
What happened?
Boolean extras (declared with 'type' => 'boolean') are written as '1' or '0' by stringifyExtra(). For a checkbox custom field whose one option is 1, '1' saves, but '0' fails the checkboxes rule ("contains invalid options"). So a device whose value is false can't be saved at all. #19628 describes mapping boolean extras such as Kandji's MDM Enabled to a checkbox custom field, and that path fails for every false value.
We hit it on a develop test instance while building the Sophos Central adapter from #19696. Its tamper-protection flag is a boolean extra mapped to a checkbox field. The 2 endpoints with tamper protection off got none of their mapped values, while the other 91 were fine. The run still reported 0 errors; I'm filing that part separately.
Steps to reproduce:
- Create a checkbox custom field with one option,
1, and add it to the model's fieldset.
- Map any boolean extra to it.
- Sync a device whose value for that extra is false.
The asset fails validation and none of its mapped values are saved. Setting the same field to an empty string saves fine.
Expected: false leaves the checkbox unchecked. One way would be for stringifyExtra() to return an empty string for a false boolean.
Drafted with help from an AI assistant. The results are from our own test instance.
What browsers are you seeing the problem on?
No response
Can you reproduce this on the public demo?
N/A
Do you have full multiple company support enabled?
No
If you have full multiple company support enabled, do you have location scoping to company enabled?
I do not have full multiple company support enabled
Application log output
Nothing is logged. The asset's validation message ($asset->getErrors()):
snipeit sophos tamper protection 5 contains invalid options.
Browser console output
No response
Common Issues
Code of Conduct
Snipe-IT Version
develop d33c59c (our test instance); these code paths are unchanged on current develop (7fe44cd)
PHP Version
8.3.6
Composer Version
2.7.1
MySQL/MariaDB version
MariaDB 10.11.14
How did you install Snipe-IT?
Git install
Is this a fresh install or an upgrade?
Fresh install
What happened?
Boolean extras (declared with
'type' => 'boolean') are written as'1'or'0'bystringifyExtra(). For a checkbox custom field whose one option is1,'1'saves, but'0'fails thecheckboxesrule ("contains invalid options"). So a device whose value is false can't be saved at all. #19628 describes mapping boolean extras such as Kandji's MDM Enabled to a checkbox custom field, and that path fails for every false value.We hit it on a develop test instance while building the Sophos Central adapter from #19696. Its tamper-protection flag is a boolean extra mapped to a checkbox field. The 2 endpoints with tamper protection off got none of their mapped values, while the other 91 were fine. The run still reported 0 errors; I'm filing that part separately.
Steps to reproduce:
1, and add it to the model's fieldset.The asset fails validation and none of its mapped values are saved. Setting the same field to an empty string saves fine.
Expected: false leaves the checkbox unchecked. One way would be for
stringifyExtra()to return an empty string for a false boolean.Drafted with help from an AI assistant. The results are from our own test instance.
What browsers are you seeing the problem on?
No response
Can you reproduce this on the public demo?
N/A
Do you have full multiple company support enabled?
No
If you have full multiple company support enabled, do you have location scoping to company enabled?
I do not have full multiple company support enabled
Application log output
Browser console output
No response
Common Issues
Code of Conduct