Saving "0" value in numeric fields when it's empty #9440
Labels
Area: Studio
Issues & PRs related to all things regarding studio & module builder
Priority:Moderate
Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds
Status:Fix Proposed
A issue that has a PR related to it that provides a possible resolution
Type:Bug
Bugs within the core SuiteCRM codebase
In a new module (from the ModuleBuilder) that contains a non-required non-custom/core numeric field (integer or float). If the record is saved without filling that field, the field will display and contain (in DB) a "0" value.
After, if you edit the record, remove the 0 and save it again, it saves fine.
Issue
The numeric fields with default empty value are wrongly filled with a "0" after the saving the record. This happens with non-required non-custom/core numeric field (integer or float) from newly created modules from Module builder
Expected Behavior
It should be saved "null" if no value is set.
Actual Behavior
A "0" value appears on that field.
Possible Fix
Change behaviour of the DBManager for those fields.
Steps to Reproduce
Context
This is very confusing. It isn't the same a value 0 than an empty one. This should be fixed.
Your Environment
SuiteCRM Version used: Version 7.12.2
Browser name and version: Chrome Versión 97.0.4692.71 (Build oficial) (64 bits)
Environment name and version: MySQL, PHP 7
Operating System and version: Ubuntu 18.04
The text was updated successfully, but these errors were encountered: