mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Fix to prevent unintended results from getComponentsQuery(...)
Wrapped $filter inside parentheses to prevent unintended results if $filter contains "OR".
This commit is contained in:
parent
33b9b18a4c
commit
8ec6312f3f
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user