Merge pull request #797 from stozze/2.4-bugfix

BUGFIX Fix to prevent unintended results from getComponentsQuery(...)
This commit is contained in:
Ingo Schommer 2012-09-17 17:04:13 -07:00
commit 201fb485a9

View File

@ -1307,7 +1307,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
// get filter
$combinedFilter = "\"$joinField\" = '$id'";
if($filter) $combinedFilter .= " AND {$filter}";
if(!empty($filter)) $combinedFilter .= " AND ({$filter})";
return singleton($componentClass)->extendedSQL($combinedFilter, $sort, $limit, $join);
}