Skip to content

Commit

Permalink
Merge branch 'feature-PRESIDECMS-2941_selectData-savedFilters-extraJo…
Browse files Browse the repository at this point in the history
…ins-is-not-accounted-for' into release-10.28.0
  • Loading branch information
Pixl8RusselCole committed Nov 27, 2024
2 parents 3744564 + 1fe22a0 commit e1844b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ component {
return {
filter = filter.filter ?: {}
, filterParams = filter.filterParams ?: {}
, having = filter.having ?: ""
, extraJoins = filter.extraJoins ?: []
};
}

Expand Down
27 changes: 15 additions & 12 deletions system/services/presideObjects/PresideObjectService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ component displayName="Preside Object Service" {
}
}

args.savedFilterList = [];

var filterService = _getFilterService();

for( var savedFilter in arguments.savedFilters ){
ArrayAppend( args.savedFilterList, filterService.getFilter( savedFilter ) );
}

args.extraFilters.append( _expandSavedFilters( argumentCollection=args ), true );

if ( args.useCache ) {
Expand Down Expand Up @@ -3384,10 +3392,10 @@ component displayName="Preside Object Service" {

private array function _convertObjectJoinsToTableJoins(
required array joins
, array extraJoins = []
, array extraFilters = []
, array savedFilters = []
, struct preparedFilter = {}
, array extraJoins = []
, array extraFilters = []
, array savedFilterList = []
, struct preparedFilter = {}
) {
var tableJoins = [];
var objJoin = "";
Expand Down Expand Up @@ -3430,9 +3438,7 @@ component displayName="Preside Object Service" {

tableJoins.append( arguments.extraJoins, true );

for( var savedFilter in arguments.savedFilters ){
savedFilter = _getFilterService().getFilter( savedFilter );

for( var savedFilter in arguments.savedFilterList ){
if ( IsArray( savedFilter.extraJoins ?: "" ) ) {
tableJoins.append( savedFilter.extraJoins, true );
}
Expand Down Expand Up @@ -3850,13 +3856,10 @@ component displayName="Preside Object Service" {
return _relationshipPathCalcCache[ cacheKey ];
}

private array function _expandSavedFilters( required array savedFilters ) {
private array function _expandSavedFilters( required array savedFilterList ) {
var expanded = [];
var filterService = _getFilterService();

for( var savedFilter in arguments.savedFilters ){
savedFilter = filterService.getFilter( savedFilter );

for( var savedFilter in arguments.savedFilterList ){
expanded.append({
filter = savedFilter.filter ?: {}
, filterParams = savedFilter.filterParams ?: {}
Expand Down

0 comments on commit e1844b6

Please sign in to comment.