Skip to content
Browse files

Merge pull request #797 from stozze/2.4-bugfix

BUGFIX Fix to prevent unintended results from getComponentsQuery(...)
  • Loading branch information...
2 parents 33b9b18 + 8ec6312 commit 201fb485a97f43ee5526c9b1bf2381575ec58426 @chillu chillu committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/model/DataObject.php
View
2 core/model/DataObject.php
@@ -1307,7 +1307,7 @@ public function getComponentsQuery($componentName, $filter = "", $sort = "", $jo
// get filter
$combinedFilter = "\"$joinField\" = '$id'";
- if($filter) $combinedFilter .= " AND {$filter}";
+ if(!empty($filter)) $combinedFilter .= " AND ({$filter})";
return singleton($componentClass)->extendedSQL($combinedFilter, $sort, $limit, $join);
}

0 comments on commit 201fb48

Please sign in to comment.
Something went wrong with that request. Please try again.