Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Bug #4702 Fatal error in NestedSet.php:1856 /w patch
Submitted: 2005-06-29 14:07 UTC
From: tacker Assigned: datenpunk
Status: Closed Package: DB_NestedSet
PHP Version: 5_1 CVS-2005-06-29 OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2005-06-29 14:07 UTC] tacker
Description: ------------ Fatal error: Cannot use object of type DB_NestedSet_Node as array in /usr/lib/php/DB/NestedSet.php on line 1856 You are dealing with objects here. See patch --- /usr/lib/php/DB/NestedSet.php.1.3.6b 2005-06-29 16:02:19.000000000 +0200 +++ /usr/lib/php/DB/NestedSet.php 2005-06-29 16:05:10.000000000 +0200 @@ -1851,8 +1851,9 @@ } $retArray = array(); - foreach($nodeSet AS $nodeID=>$node) { - $deepArray[$node['parent']][$nodeID] = $node; + $deepArray = array(); + foreach($nodeSet AS $nodeID => $node) { + $deepArray[$node->parent][$nodeID] = $node; } $reset = true; Reproduce code: --------------- $DBNS->setSortMode(NESE_SORT_PREORDER); $DBNS->getSubbranch($Node->id);

Comments

 [2005-10-25 23:16 UTC] datenpunk at php dot net
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Thanks! -- Daniel Khan