If a Mass Update is performed on a module containing dynamic fields with underscores in parent field keys, the child field's default value is always set, regardless if a change has been made to the dynamic parent field. This issue is closely related to https://github.com/salesagility/SuiteCRM/issues/8209 however the proposed fix in https://github.com/salesagility/SuiteCRM/pull/10340 does not fix this issue if a custom dynamic dropdown is still in the Cases module and this can happen with no change to the dynamic dropdowns.
examples of dynamic dropdown options that would be affected:
Mass Update should not change dynamic dropdown child values if no change has been made to the parent field.
Actual Behavior
In the above example, health_and_safety_fire compares "health" to "health and safety" and assumes it is a different parent value. This is because the Mass Update function checks for the underscore delimiter regardless of the key values.
Possible Fix
check that health_and_safety_fire contains health_and_safety at strpos 0 to see if the child field should be set to the default value.
Steps to Reproduce
Add a dynamic dropdown with keys containing underscores to a module
Create a record and set the child value to non-default(not the first value)
Perform a mass update on the record, with no changes to the dynamic dropdowns
The dynamic dropdown child field will be set to the default value.
Context
Your Environment
SuiteCRM Version used: 7.14.3
Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 124.0.1
Environment name and version (e.g. MySQL, PHP 7): PHP 8.2
Operating System and version (e.g Ubuntu 16.04): Ubuntu 22.04.4 LTS
Issue
If a Mass Update is performed on a module containing dynamic fields with underscores in parent field keys, the child field's default value is always set, regardless if a change has been made to the dynamic parent field. This issue is closely related to https://github.com/salesagility/SuiteCRM/issues/8209 however the proposed fix in https://github.com/salesagility/SuiteCRM/pull/10340 does not fix this issue if a custom dynamic dropdown is still in the Cases module and this can happen with no change to the dynamic dropdowns.
examples of dynamic dropdown options that would be affected:
Expected Behavior
Mass Update should not change dynamic dropdown child values if no change has been made to the parent field.
Actual Behavior
In the above example, health_and_safety_fire compares "health" to "health and safety" and assumes it is a different parent value. This is because the Mass Update function checks for the underscore delimiter regardless of the key values.
Possible Fix
check that health_and_safety_fire contains health_and_safety at strpos 0 to see if the child field should be set to the default value.
Steps to Reproduce
Context
Your Environment