warning: array_merge() [function.array-merge]: Argument #1 is not an array in C:\webapps\xampp\htdocs\drupal\includes\menu.inc on line 351.

Shows up at the top of the ShoutBox block. I'm running Drupal on the latest XAMPP.

http://bhive.no-ip.org/drupal/

CommentFileSizeAuthor
#8 menu_array.patch616 bytesgreggles

Comments

benshell’s picture

Priority: Critical » Normal

Can you provide anymore details? I've been using the Shoutbox on Drupal 4.6.3 (and before that Drupal 4.5) for quite some time now, and I've never seen this error. Besides, the only time array_merge() is called is in shoutbox_validate() when you're saving an edit to an existing shout. It sounds like you're getting this error all the time, which doesn't make sense.

tredgettdm’s picture

I too have the same problem.

warning: array_merge() [function.array-merge ]: Argument #1 is not an array in D:\Apache\htdocs\drupal\includes\menu.inc on line 351.

This occurs each time I attempt to access weblink content. The link also errors with "page not found"

Any suggestions. I do not think its is a php 5 compatibility problem. I am running drupal 4.6.3 with php5

dave T

benshell’s picture

PHP5 is the problem. I wouldn't have thought of that because I've never used PHP5, but a quick look into the PHP manual reveals that "The behavior of array_merge() was modified in PHP 5". Read Example 3 at http://us3.php.net/manual/en/function.array-merge.php.

To try and fix the error, go into the code and modify line 471 to read:

$shout = array_merge((array)$data, (array)$shout);

The only change is the addition of (array) before each parameter. Let me know if it works so I can update the CVS.

bigbman’s picture

No, that didn't do it.

http://bhive.no-ip.org/drupal/

bigbman’s picture

Actually, it was menu.inc, line 351:

$arguments = array_merge((array)$arguments, (array)explode('/', $arg));

but you were right about the array cast.

tredgettdm’s picture

This does fix the problem !.

Many Thanks

Dave T

benshell’s picture

Status: Active » Closed (fixed)

I've updated the 4.6 version with this change.

greggles’s picture

StatusFileSize
new616 bytes

benshell:
I'm looking at http://cvs.drupal.org/viewcvs/drupal/drupal/includes/menu.inc?rev=1.79.2... and don't see the change.

It could be that I'm looking at the wrong version, but I believe that 1.79.2.3 is the most recent version of this file in the DRUPAL-4-6 branch.

Did you change it in CVS on the 4-6 branch, or somewhere else. If it's somewhere else then this is still a bug in DRUPAL-4-6 and this should be in RTC (ready to commit).

I've attached this as an actual patch in case it's needed.

greggles’s picture

I see now - this was a "shoutbox" bug, not a core bug - so did you fix this in shoutbox somewhere?

I don't have shoutbox, so it must have been something else where the problem get introduced for me. Any ideas on other modules that have this problem?

I have added:

user_status
image
img_assist
gsitemap
pathauto

robertgarrigos’s picture

Project: Shoutbox » Drupal core
Version: 4.6.x-1.x-dev » 4.6.9
Component: User interface » menu system
Status: Closed (fixed) » Reviewed & tested by the community

As greggels stated before, this is not yet applied to the last 4.6.9 version. So I'm opening this bug again. And this is related to menu.inc, so changed also.

Patch provided by greggels solves this problem, which I founded in my 4.6.9 drupal on php 5.0.3 while sending a webform form.

BTW, this is still on 4.7 branch also. Have no one had this problem on 4.7 versions?

dries’s picture

Status: Reviewed & tested by the community » Needs work

This is a problem with the calling code, not with the menu system. The calling code (eg. weblinks.module or what not) needs to pass the menu system an array, and not an object or a literal value. You'll want to recategorize this bug report so that it is filed against the proper project.

shepherd’s picture

In my case, it appears that this issue was generally solved for menu callbacks with GET parameters of the form ?q=param1/param2/param3 by adding the following to the module menu definition:

"callback arguments" => array(),

For instance:

$items[] = array('path' => 'mod_stats', 'title' => t('mod user stats'),
'callback' => 'mod_stats',
'callback arguments' => array(),
'type' => MENU_CALLBACK);

magico’s picture

Status: Needs work » Fixed

Dries explained the solution. Anyone can create an issue against the proper project if that is the case.

Anonymous’s picture

Status: Fixed » Closed (fixed)
canalegrande’s picture

Long ago, but it even helped me at my Webcalendar configuration which totally had messed up after importing an .ics holiday series

arne.olafson’s picture

I got the error:
warning: array_merge() [function.array-merge]: Argument #1 is not an array ... sites/all/modules/filefield/filefield_widget.inc line 253.

Sure enough, there was an array similarly formatted. This adding (array) worked for me, I'm running php5