Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 (from r98403)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102651 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit dc21cb9ae0b5ac190d2221efa110976aa19fae91 1 parent 804c588
@chillu chillu authored
Showing with 7 additions and 2 deletions.
  1. +4 −1 core/model/Hierarchy.php
  2. +3 −1 tests/model/HierarchyTest.php
View
5 core/model/Hierarchy.php
@@ -369,7 +369,10 @@ public function loadDescendantIDListInto(&$idList) {
continue;
}
$idList[] = $child->ID;
- $child->getExtensionInstance('Hierarchy')->loadDescendantIDListInto($idList);
+ $ext = $child->getExtensionInstance('Hierarchy');
+ $ext->setOwner($child);
+ $ext->loadDescendantIDListInto($idList);
+ $ext->clearOwner();
}
}
}
View
4 tests/model/HierarchyTest.php
@@ -101,7 +101,9 @@ function testLoadDescendantIDListIntoArray() {
$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);
Please sign in to comment.
Something went wrong with that request. Please try again.