Skip to content

Fix aggregated relation parsing for stored queries#8059

Merged
acwhite211 merged 1 commit intov7_12_0_6from
issue-8040
May 5, 2026
Merged

Fix aggregated relation parsing for stored queries#8059
acwhite211 merged 1 commit intov7_12_0_6from
issue-8040

Conversation

@acwhite211
Copy link
Copy Markdown
Member

@acwhite211 acwhite211 commented May 5, 2026

Fixes #8040

Fixes saved stored queries where (aggregated) to-many relationship fields, like Collecting Event > Collectors (aggregated), were parsed incorrectly after reload. The parser was treating the repeated relationship name in the saved string id as a tree rank, which caused query execution to join through the related table directly and return duplicate rows instead of one aggregated value. Solved by preserving already parsed to-many relation fields when reading saved stored query string ids.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list

Testing instructions

#8040 (comment)

  • Open Query Builder for Collection Object.
  • Add a display field for Collecting Event > Collectors (aggregated).
  • Use test data where one collection object’s collecting event has multiple collectors.
  • Run the query and verify the collection object appears once, with all collectors shown in the aggregated collectors cell.
  • Save the query, reopen it, and run it again.
  • Verify the reopened query still returns one row per collection object and does not split collectors into duplicate rows.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb897f67-4b92-4109-befe-63b14aca9afd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8040

Comment @coderabbitai help to get the list of available commands and usage tips.

@acwhite211 acwhite211 marked this pull request as ready for review May 5, 2026 15:21
@acwhite211 acwhite211 requested review from a team and CarolineDenis May 5, 2026 15:21
@acwhite211 acwhite211 added this to the 7.12.0.6 milestone May 5, 2026
Copy link
Copy Markdown
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • Verify the reopened query still returns one row per collection object and does not split collectors into duplicate rows.

Looks good, results return only one row!

Image

@emenslin emenslin requested a review from a team May 5, 2026 17:57
@acwhite211 acwhite211 merged commit a7317f8 into v7_12_0_6 May 5, 2026
15 checks passed
@acwhite211 acwhite211 deleted the issue-8040 branch May 5, 2026 18:01
@github-project-automation github-project-automation Bot moved this from 📋Back Log to ✅Done in General Tester Board May 5, 2026
@CarolineDenis CarolineDenis linked an issue May 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

(aggregated) not aggregating

3 participants