Report parameters use the report module to fix formatting #5128

Open
opened 2026-02-20 16:30:06 -05:00 by deekerman · 0 comments
Owner

Originally created by @ojs87 on GitHub (Nov 8, 2023).

Issue

When you add a parameter to a Report and press update, the value of the parameter is sent through the fixUpFormatting() function.

Currently the the field type of the Report module is always used if the field name exists in the report module. This means related fields can be using the wrong field type when fixing the formatting.

If a module has a Name field with an "int" type and is related to a module with a Name field with a "text" type, a report parameter for this relation will set the text value to a 0.

Expected Behavior

fixUpFormatting should use the field type of the related module.

Actual Behavior

fixUpFormatting uses the field type of the report module.

Possible Fix

Find the field type of the related module using the $path variable. This is done elsewhere in the aor_utils.php file.

Steps to Reproduce

  1. Create a field in the Accounts module called "TestInt" with a field type of "int"
  2. Create a field in the Contacts module called "TestInt" with a field type of "varchar"
  3. Create a Report on the Accounts module
  4. Add a Condition Parameter pointing to the "TestInt" field on the Accounts:Contacts relationship
  5. On the report detail view, type a text value like "test" into the "TestInt" parameter and press Update
  6. The "TestInt" parameter value will be set to 0 since it uses the Accounts field type rather than the Contacts field type

Your Environment

  • SuiteCRM Version used: SuiteCRM 7.14.1
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox v100
  • Environment name and version (e.g. MySQL, PHP 7): PHP8.2
  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 22.04.3 LTS
Originally created by @ojs87 on GitHub (Nov 8, 2023). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> <!--- Please be aware that as of the 31st January 2022 we no longer support 7.10.x. New issues referring to 7.10.x will only be valid if applicable to 7.12.x and above. If your issue is still applicable in 7.12.x, please create the issue following the template below --> #### Issue When you add a parameter to a Report and press update, the value of the parameter is sent through the fixUpFormatting() function. Currently the the field type of the Report module is always used if the field name exists in the report module. This means related fields can be using the wrong field type when fixing the formatting. If a module has a Name field with an "int" type and is related to a module with a Name field with a "text" type, a report parameter for this relation will set the text value to a 0. #### Expected Behavior fixUpFormatting should use the field type of the related module. #### Actual Behavior fixUpFormatting uses the field type of the report module. #### Possible Fix Find the field type of the related module using the $path variable. This is done elsewhere in the aor_utils.php file. #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Create a field in the Accounts module called "TestInt" with a field type of "int" 2. Create a field in the Contacts module called "TestInt" with a field type of "varchar" 3. Create a Report on the Accounts module 4. Add a Condition Parameter pointing to the "TestInt" field on the Accounts:Contacts relationship 5. On the report detail view, type a text value like "test" into the "TestInt" parameter and press Update 6. The "TestInt" parameter value will be set to 0 since it uses the Accounts field type rather than the Contacts field type #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: SuiteCRM 7.14.1 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox v100 * Environment name and version (e.g. MySQL, PHP 7): PHP8.2 * Operating System and version (e.g Ubuntu 16.04): Ubuntu 22.04.3 LTS
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5128
No description provided.