Two days ago I performed an update from 6.x-2.0-beta to 6.x-2.x-dev. Since then I get the error message
warning: Invalid argument supplied for foreach() in /usr/home/caiiorg/public_html/includes/menu.inc on line 258.
as soon as I edit one of my pages.
It doesn't seem to have any negative effect though, but still my users editing the page are uncomfortable...

Would be great if there'd be a fix for this!

Comments

reikiman’s picture

I'm getting the same message

Google shows a fix in contemplate ..
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/contemplate...

And also a fix in userpoints...
http://drupal.org/node/239476

In both cases the fix involved some changes to the menu declarations.

Matt V.’s picture

In case it might help, the message is probably related to the fact that in Drupal 6 "access arguments" changed to an array. I ran across this issue in an attempt to fix the same error message in a module I'm updating, so I'm just passing along what I found that helped me.

KarenS’s picture

Status: Active » Fixed

What makes anyone think this is a CCK issue? I see no reason to think it has anything to do with CCK. Every place in CCK that uses access arguments is already using an array.

If there is some reason to think this is coming from CCK, I need more info.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

SloanInnovations’s picture

I'm getting the same error at http://bowtasticboutique.com, I upgraded a couple modules at once last week and I can't seem to pinpoint which is causing the issue? Anyone know a new module that is now causing this same problem

Anonymous’s picture

From what a couple of others have said online this error may be appearing as the menu does not like an argument passed to it.

http://www.centurionwebdev.com/content/warning-invalid-argument-supplied...
http://www.aprium.net/content/error-menuinc-line-258

In my case I think its from a new 'view' that I am using an argument in (but I have no idea how or whether this needs 'fixing').

Anonymous’s picture

Ok I am following this up as I think I may have solved the errors I am having - fingers crossed.

I have 'Pathauto' module loaded and mistakedly used a leading slash in the replacement paths.

So for example my default is [menupath-raw] but I had put /[menupath-raw]

Hope that helps someone.

Anonymous’s picture

Bother that was a premature evaluation!

Am still getting these errors.

Best I can do is post the code here in the hopes that one of the core development team see it, and know how to explain what all our problems may be.

/**
* The menu system uses serialized arrays stored in the database for
* arguments. However, often these need to change according to the
* current path. This function unserializes such an array and does the
* necessary change.
*
* Integer values are mapped according to the $map parameter. For
* example, if unserialize($data) is array('view', 1) and $map is
* array('node', '12345') then 'view' will not be changed because
* it is not an integer, but 1 will as it is an integer. As $map[1]
* is '12345', 1 will be replaced with '12345'. So the result will
* be array('node_load', '12345').
*
* @param @data
* A serialized array.
* @param @map
* An array of potential replacements.
* @return
* The $data array unserialized and mapped.
*/
function menu_unserialize($data, $map) {
if ($data = unserialize($data)) {
foreach ($data as $k => $v) {
if (is_int($v)) {
$data[$k] = isset($map[$v]) ? $map[$v] : '';
}
}
return $data;
}
else {
return array();
}
}

ianfoxfire’s picture

Solution...
looks like hook_menu --> 'access arguments' is expecting an array...

replace this
'access arguments' => 'edit your mom',

with this:
'access arguments' => array('edit your mom')

Manjit.Singh’s picture

Assigned: Unassigned » Manjit.Singh
Category: support » task
Priority: Normal » Critical

replace 'access arguments' => 'name',

with 'access arguments' => array('name')