Hi there,

Just installed Drupal 7.12 and am using it with the standard Bartik theme. For testing, I installed the Zen theme. But when wanting to set that theme as default (and when switching back), I get the following error message:

Notice: Array to string conversion in menu_link_save() (line 3155 of /var/www/virtual/host/html/includes/menu.inc).

This message indeed comes up when doing a number of things. What I want to do (e.g. switching default themes) does work, but I get a number of these error messages which looks very stupid.

Is there any way to get rid of this?

Thank you very much in advance and best regards,
Jens

Comments

christopher james francis rodgers’s picture

Hello: J Fischer

If you have a problem or question about a specific module, you should create an issue in the module's issue queue (after checking for an existing issue first).

The Zen project issues que is at
http://drupal.org/project/issues/zen

For more details on getting help on specific projects, see...

Get the Fastest Answers to Module-Specific or Theme-Specific Issues at Drupal.org - How to

http://drupal.org/node/1478010

- Chris


All the best; intended.
-Chris (great-grandpa.com)
___
"The number one stated objective for Drupal is improving usability." ~Dries Buytaert *

jfischer’s picture

Dear Chris,

Thanks for the reply, but it is not a Zen issue. It also happens when switching between other themes and when doing certain other things in the admin menu. I did a fair amount of searching for the issue but have not been able to find anything on it.

I guess it might be something with the core in menu.inc or with seven (the standard admin interface in 7.12). Don't really know how to proceed further now.

BTW: already successfully solved a similar problem in 7.12 in query.inc by way of a patch.

Best regards,
Jens

josejayesh’s picture

Got the same waring
"Notice: Array to string conversion in menu_link_save() (line 3155 of /webserver/nginx/html/drupal-7.12/includes/menu.inc)."

while doing the installation "Configure site Screen"

once the installation is completed i refresh the screen above error message disappear, but i got another error

" Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /webserver/nginx/html/drupal-7.12/includes/database/query.inc)."

I am running drupal on nginx with php-fpm (5.4.0) support

josejayesh’s picture

when i installed drupal with php 5.3.10 support this issue is not happening . problem is with 5.4.0 version

josejayesh’s picture

The above reported issue is happening if php version is 5.4.0 ,not happening with php 5.3.10

josejayesh’s picture

jfischer’s picture

Thanks,

Indeed, I have PHP 5.4.0.

Let's wait what happens.

Best regads,
Jens

technollogie’s picture


  // If every value in $existing_item is the same in the $item, there is no
  // reason to run the update queries or clear the caches. We use
  // array_intersect_assoc() with the $item as the first parameter because
  // $item may have additional keys left over from building a router entry.
  // The intersect removes the extra keys, allowing a meaningful comparison.
 if (!$existing_item || sizeof(array_diff_assoc($item, $existing_item)) > 0) {

Execute only if there is a difference between the arrays?

Still testing this patch.

Detlev

crossray’s picture

Thanks Detlev!

menu.inc fixed now, but query.inc and file.inc come with the errors.

anou’s picture

This patch seems to fix the problem for me.

David THOMAS
http://www.smol.org

tanvirahmad’s picture

Applied Patch, it worked for me.

t@n

debonair47’s picture

Please how do you apply the patch exactly, as i am not familiar with the code, just elementary php ?

hardikhm’s picture

Thanks for this post.

This really helps me and resolve the query.inc issue.

But still menu_link_save() Notice is appearing while clearing cache.

Please any help would be appreciable.

debonair47’s picture

Please how do you apply the patch exactly, as i am not familiar with the code, just elementary php ?

valthebald’s picture

richardburden’s picture

if (!$existing_item || sizeof(array_diff_assoc($item, $existing_item)) > 0) {

fixes the problem some of the time, but you will still get the same error message when $existing_item evaluates to non-zero and not boolean false, but is not an array.

better:

if ($existing_item && ! is_array($existing_item)) {$existing_item = array($existing_item);}
if (!$existing_item || sizeof(array_diff_assoc($item, $existing_item)) > 0)
 {

actually, if PHP evaluates the right hand side of || even when the left hand side is true, then the above code will also fail (I'm not sure that PHP 5.4.0 doesn't do that)

thierry.champion@telenet.be’s picture

Hi,
Having the same problem, i installed PHP 5.4.3 and the error has gone away.
Br,
Thierry

vacho’s picture

The problem is in drupal 7.12 and previous whith php 5.4.x
later versions of drupal solve this problem

avrillica’s picture

Same problem here on Drupal 7.1 and PHP version 5.4.8

hardikhm’s picture

Hi all,

I have found the solution for the "Notice: Array to string conversion in menu_link_save()" Notice.

https://drupal.org/files/menu-link-save-1338282-30-d7.patch

This is the patch that worked for me.

I hope it would be helpful to you all also.

prabhjotg’s picture

Thanks hardikhm, the patch worked for me.

vinayjoshi3’s picture

Team,

My current version of php is PHP Version 5.5.9-1ubuntu4.14, and I have installed drupal-7.0.
And after installation i am getting below notices and warning on site home page, these warnings are more than 100.

---Notice: Array to string conversion in menu_link_save() (line 3025 of /var/www/html/drupal/includes/menu.inc).

---Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1818 of /var/www/html/drupal/includes/database/query.inc).

--- Notice: Array to string conversion in menu_link_save() (line 3025 of /var/www/html/drupal/includes/menu.inc).

How to resolve? please help;