mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
ccf4db936f
commit
badd45a663
@ -369,7 +369,10 @@ class Hierarchy extends DataObjectDecorator {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$idList[] = $child->ID;
|
$idList[] = $child->ID;
|
||||||
$child->getExtensionInstance('Hierarchy')->loadDescendantIDListInto($idList);
|
$ext = $child->getExtensionInstance('Hierarchy');
|
||||||
|
$ext->setOwner($child);
|
||||||
|
$ext->loadDescendantIDListInto($idList);
|
||||||
|
$ext->clearOwner();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,9 @@ class HierarchyTest extends SapphireTest {
|
|||||||
|
|
||||||
$this->assertContains($page2a->ID, $page2IdList);
|
$this->assertContains($page2a->ID, $page2IdList);
|
||||||
$this->assertContains($page2b->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($page2aa->ID, $page2aIdList);
|
||||||
$this->assertContains($page2ab->ID, $page2aIdList);
|
$this->assertContains($page2ab->ID, $page2aIdList);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user