Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291721

Invalid argument supplied for foreach() in menu_unserialize() (line 400 of includes/menu.inc).

$
0
0

Warning: Invalid argument supplied for foreach() in menu_unserialize() (line 400 of /var/www/kwpkrakow/includes/menu.inc).

I'm not sure what is the reason of this warning, probably it started to show when I started to use multilingual menu - but I'm not sure about it.
No matter what - here is the solution for this problem:

function menu_unserialize($data, $map) {
if ($data = unserialize($data)) {
+ if ((!is_array($data)) && (!is_object($data))) {
+ return $data;
+ }
foreach ($data as $k => $v) {
if (is_int($v)) {
$data[$k] = isset($map[$v]) ? $map[$v] : '';

Maybe it will be useful for someone.


Viewing all articles
Browse latest Browse all 291721

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>