warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/html/includes/menu.inc on line 351.

Is printed on submit. Not sure where the problem is.

Comments

zuryasse’s picture

yeah, same problem here...

ullgren’s picture

I'm still saying this is a issue with the menu.inc.

The code is as follows:

    $arguments = array_key_exists('callback arguments', $menu['items'][$mid]) ? $menu['items'][$mid]['callback arguments'] : array();
    $arg = substr($_GET['q'], strlen($menu['items'][$mid]['path']) + 1);
    if (strlen($arg)) {
        $arguments = array_merge($arguments, explode('/', $arg));
    }

There should be a check to verify that $arguments really is a array.

Anyway please test the following patch:


diff -u -r1.48.2.6 webform.module
--- webform.module      18 Nov 2005 09:11:08 -0000      1.48.2.6
+++ webform.module      23 Feb 2006 19:33:55 -0000
@@ -328,6 +328,7 @@
                    'access' => user_access('create webforms'));

   $items[] = array('path' => 'webform/done', 'title' => t('webform'),
+                   'callback arguments' => array(),
                    'callback' => '_webform_thanks',
                    'type' => MENU_CALLBACK,
                    'access' => true);
@@ -335,6 +336,7 @@
   // Upgrade page for the webform
   $items[] = array('path' => 'webform/upgrade', 'title' => t('Webform upgrade page'),
                    'callback' => '_webform_update',
+                   'callback arguments' => array(),
                    'type' => MENU_CALLBACK,
                    'access' => ($user->uid == 1)); // Access only for the "admin" user.
ullgren’s picture

Assigned: Unassigned » ullgren
Status: Active » Needs review
mariuss’s picture

I had the very same problem. After I applied the patch everything is OK. Thanks.

ullgren’s picture

Status: Needs review » Fixed

patch applied to CVS (4.6 branch)

johnhanley’s picture

I just got this error with a new installation of PHP 5 (worked fine under 4.x)

I remedied the problem by modifying line 351 of menu.inc to insure $arguments is an array:

if (strlen($arg) && is_array($arguments)) {

johnhanley’s picture

Or perhaps this is a more eloquent and officially sanctioned solution.

Anonymous’s picture

Status: Fixed » Closed (fixed)