The error was warning: array_unique() [function.array-unique]: The argument should be an array in /sites/all/modules/boost/boost.module on line 808.

It seems to be happening because occasionally $menu is an empty array.

To fix this I just initialised the structure array at the beginning of the function.

Additionally I noticed a typo on line 794

  $structure[$item['link']['link_path']][] = $sub;

The variable $sub is never defined (AFAIK) - I guess it should be $sub_menu.

Patch attached...

As the comment says above the boost_get_menu_structure()... ugly code :)

p.s. Thanks for a great and amazing module - got a 2gb VPS serving 4000+ requests per seconds... awesome!

Comments

alexpott’s picture

StatusFileSize
new826 bytes

Somehow the patch fell off the post :(

Here it is.

mikeytown2’s picture

Status: Active » Fixed
alexpott’s picture

Version: 6.x-1.18 » 6.x-1.x-dev
Status: Fixed » Needs review
StatusFileSize
new357 bytes

It seems that this issue was solved before #673874: array_unique() error - I did look in the issue queue before posting but I obviously missed it...

The previous fix added the checks

  if (isset($structure) && is_array($structure)) {
     $structure = array_unique($structure);
  }

which are now unnecessary as the $structure is initialised to an array.

Patch attached to remove them as it is probably slightly quicker to initialise rather than do the two tests on the $structure variable.

mikeytown2’s picture

cleanup code gets run once... I'm not too worried about this ATM. If you think it's important I'll commit it but to me the patch doesn't seem necessary.

mikeytown2’s picture

Status: Needs review » Closed (won't fix)

keeping the code as is.