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:
Sean Harvey 2012-09-04 20:08:25 -07:00
commit c61d4aacc3

View File

@ -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;