Home » Database » DB_NestedSet » Bug #1423
Wrong generated structure for Menu
Details
| Submitted | 2004-05-17 10:51 UTC |
|---|---|
| From | pear at garv dot info |
| Assigned | datenpunk |
| Status | Closed |
| Package | DB_NestedSet |
| PHP Version | 4.3.6 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-05-17 10:51 UTC] pear at garv dot info
Description:
------------
I'm using the latest Nested Set version (1.3.4) to generate a nested set using the 'Menu' output driver.
I found out that in my setup a subcategory was wrongly identified as core level.
My structure is like this:
$parent = $nestedSet->createRootNode(array('kategoriename' => 'Testberichte'), false, true);
$nestedSet->createSubNode($parent, array('kategoriename' => 'Pads, Sattelunterlagen'));
$nestedSet->createSubNode($parent, array('kategoriename' => 'Kartentaschen'));
$nestedSet->createSubNode($parent, array('kategoriename' => 'Kartenmesser'));
$nestedSet->createSubNode($parent, array('kategoriename' => 'Erste Hilfe Sets'));
$nestedSet->createSubNode($parent, array('kategoriename' => 'Outdoor Jacken'));
$nestedSet->createSubNode($parent, array('kategoriename' => 'flexible Sattel'));
And the last item ('flexible Sattel') was always shown as a root level.
I found out that by editing the Menu.php, line 119 was the one causing problems:
// We are at a rootnode - let's add it to the structure
if ($key == $node['rootid']) {
I modified the if-clause to read
if ($node['id'] == $node['rootid'])
and everything's now working fine for me. As I however haven't looked more than 10 minutes into the code I don't know if it breaks something. Would be happy if you could have a look at it. If you need more code example or information, please contact me.
[2004-07-23 23:26 UTC] dk at webcluster dot at
This bug has been fixed in CVS.
In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.
In case this was a pear.php.net website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PEAR better.