Browse Source

Fix possible wrong populateTree()

tags/v1.0.3 v1.0.3
PaulZi 9 years ago
parent
commit
243d0f6937
  1. 2
      NestedSetsBehavior.php

2
NestedSetsBehavior.php

@ -246,7 +246,7 @@ class NestedSetsBehavior extends Behavior
$prev = $depth; $prev = $depth;
} }
$nodes[$this->owner->getAttribute($this->leftAttribute)] = $this->owner; $nodes[] = $this->owner;
foreach ($nodes as $node) { foreach ($nodes as $node) {
$key = $node->getAttribute($this->leftAttribute); $key = $node->getAttribute($this->leftAttribute);
if (isset($relates[$key])) { if (isset($relates[$key])) {

Loading…
Cancel
Save