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

Dynamic Fields Mass Update Issue #10404

Open
ojs87 opened this issue Apr 16, 2024 · 0 comments
Open

Dynamic Fields Mass Update Issue #10404

ojs87 opened this issue Apr 16, 2024 · 0 comments
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact 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

Comments

@ojs87
Copy link
Contributor

ojs87 commented Apr 16, 2024

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 #8209 however the proposed fix in #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:

parent dropdown keys: 
health_and_safety

child option keys:
health_and_safety_fire
health_and_safety_power_cut
health_and_safety_volcano

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

  1. Add a dynamic dropdown with keys containing underscores to a module
  2. Create a record and set the child value to non-default(not the first value)
  3. Perform a mass update on the record, with no changes to the dynamic dropdowns
  4. 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
ojs87 added a commit to ojs87/SuiteCRM that referenced this issue Apr 16, 2024
@johnM2401 johnM2401 added Type: Bug Bugs within the core SuiteCRM codebase Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact 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
Projects
None yet
Development

No branches or pull requests

2 participants