Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
reikiman CreditAttribution: reikiman commentedI'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.
Comment #2
Matt V. CreditAttribution: Matt V. commentedIn 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.
Comment #3
KarenS CreditAttribution: KarenS commentedWhat 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.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
SloanInnovations CreditAttribution: SloanInnovations commentedI'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
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedFrom 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').
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedOk 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.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedBother 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();
}
}
Comment #9
ianfoxfire CreditAttribution: ianfoxfire commentedSolution...
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')
Comment #10
Manjit.Singhreplace 'access arguments' => 'name',
with 'access arguments' => array('name')