Feature presidecms 3043 zero matching records for exported rules and conditions#1733
Conversation
…or-exported-rules-and-conditions'.
… getMatchingRecordCount
…and remove binary array
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
| , savedFilters = [] | ||
| , extraFilters = [ filter ] | ||
| ); | ||
| QuerySetCell( args.records, "segmentation_last_count", count , QueryCurrentRow( args.records ) ); |
There was a problem hiding this comment.
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.
Note
Introduces count population for filter listings to surface how many records match each condition.
postFetchRecordsForGridListingto compute and setsegmentation_last_countfor non-segmentation filters usingprepareFilter()andgetMatchingRecordCount()preFetchRecordsForGridListingto initializeselectFieldsand auto-includeid,is_segmentation_filter, andfilter_objectwhensegmentation_last_countis selected; preserves existing extra filter logicWritten by Cursor Bugbot for commit 203a198. This will update automatically on new commits. Configure here.