mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX: Fix site tree filter not showing parents of results more than a level deep in the hierachy
This commit is contained in:
parent
4ad2b25679
commit
f843dd56dc
@ -72,12 +72,14 @@ abstract class CMSSiteTreeFilter extends Object {
|
|||||||
$this->_cache_ids[$pageArr['ID']] = true;
|
$this->_cache_ids[$pageArr['ID']] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($parents)) {
|
while(!empty($parents)) {
|
||||||
$q = new SQLQuery();
|
$q = new SQLQuery();
|
||||||
$q->setSelect(array('"ID"','"ParentID"'))
|
$q->setSelect(array('"ID"','"ParentID"'))
|
||||||
->setFrom('"SiteTree"')
|
->setFrom('"SiteTree"')
|
||||||
->setWhere('"ID" in ('.implode(',',array_keys($parents)).')');
|
->setWhere('"ID" in ('.implode(',',array_keys($parents)).')');
|
||||||
|
|
||||||
|
$parents = array();
|
||||||
|
|
||||||
foreach($q->execute() as $row) {
|
foreach($q->execute() as $row) {
|
||||||
if ($row['ParentID']) $parents[$row['ParentID']] = true;
|
if ($row['ParentID']) $parents[$row['ParentID']] = true;
|
||||||
$this->_cache_ids[$row['ID']] = true;
|
$this->_cache_ids[$row['ID']] = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user