Skip to content

Feature presidecms 3043 zero matching records for exported rules and conditions#1733

Open
Pixl8RusselCole wants to merge 6 commits intostablefrom
feature-PRESIDECMS-3043_zero-matching-records-for-exported-rules-and-conditions
Open

Feature presidecms 3043 zero matching records for exported rules and conditions#1733
Pixl8RusselCole wants to merge 6 commits intostablefrom
feature-PRESIDECMS-3043_zero-matching-records-for-exported-rules-and-conditions

Conversation

@Pixl8RusselCole
Copy link
Copy Markdown
Contributor

@Pixl8RusselCole Pixl8RusselCole commented Jan 22, 2026

Note

Introduces count population for filter listings to surface how many records match each condition.

  • Adds postFetchRecordsForGridListing to compute and set segmentation_last_count for non-segmentation filters using prepareFilter() and getMatchingRecordCount()
  • Updates preFetchRecordsForGridListing to initialize selectFields and auto-include id, is_segmentation_filter, and filter_object when segmentation_last_count is selected; preserves existing extra filter logic

Written by Cursor Bugbot for commit 203a198. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 22, 2026

Test Results

    1 files  ±0    117 suites  ±0   2m 35s ⏱️ +3s
1 829 tests ±0  1 826 ✅ ±0  3 💤 ±0  0 ❌ ±0 
1 832 runs  ±0  1 829 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit 203a198. ± Comparison against base commit 9a92ef6.

♻️ This comment has been updated with latest results.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

objectName = record.filter_object
, filterId = record.id
);
var count = rulesEngineFilterService.getMatchingRecordCount(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable declared twice in same scope

Medium Severity

The variable count is declared twice using the var keyword within the same loop scope. Line 162 declares var count = 0; and line 167 redeclares it as var count = rulesEngineFilterService.getMatchingRecordCount(...). This makes the first declaration redundant and could cause engine-specific behavior issues in CFML. The second declaration should be a simple assignment without the var keyword.

Fix in Cursor Fix in Web

, savedFilters = []
, extraFilters = [ filter ]
);
QuerySetCell( args.records, "segmentation_last_count", count , QueryCurrentRow( args.records ) );
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Query iteration without local variable causes cursor issue

High Severity

The code iterates directly over args.records and calls QueryCurrentRow( args.records ) within the loop. In CFML, for...in loops don't update the query cursor, making QueryCurrentRow() unreliable and likely to return incorrect row numbers. This will cause QuerySetCell to update the wrong row or fail. All similar code in the codebase creates a local variable (e.g., var records = args.records ?: QueryNew('')) before iteration to avoid this issue.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant