BUGFIX Fixed Hierarchy->loadDescendantIdList() to call setOwner() on the extension instance. This was necessary due to underlying Object/Extension changes in 2.4.

MINOR Fixed HierarchyTest assertions around including grand children counts

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98403 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-02-08 04:00:28 +00:00 committed by Sam Minnee
parent ccf4db936f
commit badd45a663
2 changed files with 7 additions and 2 deletions

View File

@ -369,7 +369,10 @@ class Hierarchy extends DataObjectDecorator {
continue;
}
$idList[] = $child->ID;
$child->getExtensionInstance('Hierarchy')->loadDescendantIDListInto($idList);
$ext = $child->getExtensionInstance('Hierarchy');
$ext->setOwner($child);
$ext->loadDescendantIDListInto($idList);
$ext->clearOwner();
}
}
}

View File

@ -101,7 +101,9 @@ class HierarchyTest extends SapphireTest {
$this->assertContains($page2a->ID, $page2IdList);
$this->assertContains($page2b->ID, $page2IdList);
$this->assertEquals(2, count($page2IdList));
$this->assertContains($page2aa->ID, $page2IdList);
$this->assertContains($page2ab->ID, $page2IdList);
$this->assertEquals(4, count($page2IdList));
$this->assertContains($page2aa->ID, $page2aIdList);
$this->assertContains($page2ab->ID, $page2aIdList);