mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #197 from ajoneil/sitetree-filter-fix
BUGFIX: Fix site tree filter not showing parents of results more than a ...
This commit is contained in:
commit
c61d4aacc3
@ -72,12 +72,14 @@ abstract class CMSSiteTreeFilter extends Object {
|
||||
$this->_cache_ids[$pageArr['ID']] = true;
|
||||
}
|
||||
|
||||
if(!empty($parents)) {
|
||||
while(!empty($parents)) {
|
||||
$q = new SQLQuery();
|
||||
$q->setSelect(array('"ID"','"ParentID"'))
|
||||
->setFrom('"SiteTree"')
|
||||
->setWhere('"ID" in ('.implode(',',array_keys($parents)).')');
|
||||
|
||||
$parents = array();
|
||||
|
||||
foreach($q->execute() as $row) {
|
||||
if ($row['ParentID']) $parents[$row['ParentID']] = true;
|
||||
$this->_cache_ids[$row['ID']] = true;
|
||||
|
Loading…
Reference in New Issue
Block a user