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...

Comments

soghad’s picture

StatusFileSize
new851 bytes

Looks 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.

$output = '';
$edit_access = 'administer menu';

A patch implementing this change is attached.

likewhoa’s picture

Status: Active » Needs review
StatusFileSize
new759 bytes

I got a hunk failed from #1 so i made a patch against the git repo.

proindustries’s picture

StatusFileSize
new751 bytes

Patch in #2 works, but first I had to edit out the a and b sub-directories used in the patch. Updated patch attached.

John

proindustries’s picture

StatusFileSize
new773 bytes

Actually, correction - the patches so far don't initialize $editpath. This one does that as well.

pat redmond’s picture

Status: Needs review » Closed (fixed)

Should be fixed in the next release of jquerymenu for both D6 and D7