I have an error after upgrading from 5.2 to 5.3. The server is running Apache/PHP5.
There is no error on my test system which is running Apache/PHP4.
The message on the PHP5 server sounds like
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /srv/www/vhosts/oekoportal.net/subdomains/test/httpdocs/includes/menu.inc on line 415.
The line in MENU.INC is
$arguments = array_merge( $arguments, explode('/', $arg));
It seems as if $arguments is in some cases an array in some not. PHP4 was more tolerant in acting with array_merge() an accepted non-array parameters. This was changed in PHP5 with giving a message with a critical error.
After changing the line above to
$arguments = array_merge( (array) $arguments, explode('/', $arg));
it is secured that the parameter is an array and the error message is gone.
Maybe this hint may help those who have the same problem I had.
Best wishes to all Drupal developers.
Comments
Send it as an issue. Noone
Send it as an issue. Noone interested will see it in forums.
Vito
Argument #1 is not an array in .../includes/menu.inc on line 415
I had this error when I moved to PHP 5.1 from 4.x. According to http://ca.php.net/manual/tr/migration5.incompatible.php array_merge() in PHP 5 was changed to accept only arrays.
PHP 5 starts trowing this warning message about /includes/menu.inc line 415 if in your hook_menu() there are callback arguments defined like this:
Replacing those lines with
fixed the problem.
Please note: in order to see effect of this change you have to temporarily comment out all $may_cache conditions in your hook_menu() to refresh cached menus. Otherwise that warning won't disappear until menu cache expires. After first run, DO NOT forget to remove comments around $may_cache.