Skip to content

Fix #613 - Fixed Error Occurring If First Report Field Is a Custom Field #614

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

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

MaxSprea
Copy link

@MaxSprea MaxSprea commented Feb 19, 2025

Description

Lines 1245 to 1247 of AOR_Report.php were in the wrong order causing the first iteration of the loop to return an empty $data array which in turn caused the generated query to fail if a custom field was used as the first field:

$data = $field_module->field_defs[$field->field] ?? [];

$field_module = $module;

I simply inverted the lines and can confirm that reports work properly after applying the fix

$field_module = $module;

$data = $field_module->field_defs[$field->field] ?? [];

Motivation and Context

This fix is necessary to correctly manage custom fields when used as first field of a report

How To Test This

Create a report using a custom field as the first field of the report

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@SuiteBot
Copy link

SuiteBot commented Feb 19, 2025

CLA assistant check
All committers have signed the CLA.

$field_module = $module;

$data = $field_module->field_defs[$field->field] ?? [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should really be below the foreach statement on approx line 1268 as the field_module may change

@mattlorimer mattlorimer added Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status:Requires Updates Issues & PRs which requires input or update from the author PR 1-3 Complexity Score given to PRs once assessed labels Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR 1-3 Complexity Score given to PRs once assessed Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status:Requires Updates Issues & PRs which requires input or update from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants