Following the best practices advice of Randy Fray (http://randyfay.com/node/76) I turned E_NOTICE on at a development Drupal 6.19 installation. The jqueryMenu.module generates 396 warning messages, all about the undeclared use of three variables in the recursive_link_creator() function. The three variables are: $output, $editpath, and $edit_access
I can simply set $editPath to NULL and $edit_access to "" and the menu continues to work. However, if I set $output to anything, the menu does not render at all. I ended up fixing the issue with this added at line 367, right before the first usage of $output in the recursive_link_creator() function:
// Blake mod Sept 14, 2010:
// getting rid of undefined variables
if (!isset($output))
$output = '';
$editpath = NULL;
$edit_access = ''; // what should this be?
// end of Blake mod
This type of change is required for php 5, I'm told. You may want to adopt the use of E_NOTICE in your own development...
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | jquerymenu-911726-4.patch | 773 bytes | proindustries |
| #3 | jquerymenu-911726-3.patch | 751 bytes | proindustries |
| #2 | jquerymenu-100644.patch | 759 bytes | likewhoa |
| #1 | jquerymenu-911726.patch | 851 bytes | soghad |
Comments
Comment #1
soghad commentedLooks like a couple of vars just need to be initialized at the beginning of the function. This would be consistent with other functions in the module.
It seems to me that $edit_access should be initialized to 'administer menu', since that is what is required "out of the box" to edit a menu.
A patch implementing this change is attached.
Comment #2
likewhoa commentedI got a hunk failed from #1 so i made a patch against the git repo.
Comment #3
proindustries commentedPatch in #2 works, but first I had to edit out the a and b sub-directories used in the patch. Updated patch attached.
John
Comment #4
proindustries commentedActually, correction - the patches so far don't initialize $editpath. This one does that as well.
Comment #5
pat redmond commentedShould be fixed in the next release of jquerymenu for both D6 and D7