Category Tree Menu plugin
Posted: Fri Feb 02, 2007 5:09 pm
Garvin & Co.
Since I'm not much of a PHP guru, I consulted with Judebert on this one to make sure I wasn't out of my depth.
The category tree menu plugin is great, but there've been a lot of posts about problems with it, sometimes people just abandon it altogether. I've found what seems to be a bug (at least on my system) in the way it handles the TreeMenu includes.
What follows is the text from my PM to Judebert:
What do you folks think?
Since I'm not much of a PHP guru, I consulted with Judebert on this one to make sure I wasn't out of my depth.
The category tree menu plugin is great, but there've been a lot of posts about problems with it, sometimes people just abandon it altogether. I've found what seems to be a bug (at least on my system) in the way it handles the TreeMenu includes.
What follows is the text from my PM to Judebert:
I have absolutely no idea why $pear would cease to be true, but based on a couple of echo statements I inserted to test the problem that is exactly what happens. Changing that second if to an elseif eliminates the problem.Found something that might be causing the chokage we keep seeing on various installations of the category tree dhtml menu plugin...
in serendipity_plugin_category_dhtml_menu.php, starting at line 101 (now at line 106):I find that if the first include works and the second fails $pear ceases to be true and the remainder of the functional code in the plugin is no longer executed.Code: Select all
$pear = false; if (@include_once('HTML/TreeMenu.php')) { $pear = true; } if (@include_once('HTML_TreeMenu/TreeMenu.php')) { $pear = true; } if ($pear) { rest of plugin code }
I changed the second if to an elseif and it appears that the code works properly.
Why is this the case?
I'm not much of a PHP hack, consider myself barely literate, so I thought I'd ask you first rather than posting a bugfix. I was thinking to myself that maybe it was a 'feature'. (-:
Let me know.
What do you folks think?