After upgrading core to 6.14, accessing the Drupal Tweaks module now yields this error:

Fatal error: Unsupported operand types in (blah blah sitepath blah)/modules/system/system.module on line 627

Comments

kenorb’s picture

It's probably Drupal core bug.

Line:

$item += db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));

Possible related issues:
#471964: Rules administration menu broken - Fatal error: Unsupported operand types in modules/system/system.module on line 626
#458880: admin/rules on the administration menu no longer works
#421250: Unsupported operand types in system.module on line 626
#346945: Events not appearing after upgrade to Drupal 6.8
#116895: Show regions at 404 page #25
#149562: Menu module causes duplicate menu items
#550254: Menu links are sometimes not properly re-parented
#251792: Implement a locking framework for long operations

Probably you have corrupted menu_links table and Drupal can't find proper menu item (on system_admin_menu_block_page callback).

Possible solutions:
1. Make sure that you already upgraded Drupal through /update.php page
2. If you are using admin_menu, please disable it (issue: #511744: /admin page links are broken with latest development snapshot)
3. Go to admin/build/modules to rebuild your menu_router table
4. Install DTools module and run wsod_emergency.php?q=your_wsod_path page (paste the output)

cdmarine’s picture

Possible solutions:
1. Make sure that you already upgraded Drupal through /update.php page
2. If you are using admin_menu, please disable it (issue: #511744: /admin page links are broken with latest development snapshot)
3. Go to admin/build/modules to rebuild your menu_router table
4. Install DTools module and run wsod_emergency.php?q=your_wsod_path page (paste the output)

1. Check
2. Not using

I'll give 3 & 4 a shot, but it'll have to wait until next week. Will return and update then.

cdmarine’s picture

... though, FYI, I just completed a fresh Drupal installation for a different site, and installed Drupal Tweaks before doing anything else (same version, of course), and it works fine. Definitely something corrupted in the other site.

kenorb’s picture

Project: Drupal tweaks » Diagnostic Tools
Component: General » Miscellaneous
Category: bug » support
Priority: Critical » Normal
lappn’s picture

hi there, replace the "+" in system.module on line 627 with a ".", then it should work again.

original: $item += db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));

new: $item .= db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));

SORRY, NO GOOD!!! As a result no objects are shown in /admin/*. It only results in: You do not have any administrative items.

P.S. I know, never mess in the system files.

kenorb’s picture

It's workaround, but it's not a solution from Drupal perspective.
Something causing that this item in menu_links is missing and there should be some reason, which should be found.

tim-drupal’s picture

Version: 6.x-1.x-dev » 6.x-1.1-rc1
Priority: Normal » Critical

Hi there,

I'm experiencing a similar problem to cdmarine, whith SMS Framework module:

After upgrading core to 6.14, accessing the Drupal Tweaks module now yields this error:

Fatal error: Unsupported operand types in (blah blah sitepath blah)/modules/system/system.module on line 627

I went through the steps described in #1

Possible solutions:
1. Make sure that you already upgraded Drupal through /update.php page
2. If you are using admin_menu, please disable it (issue: #511744: /admin page links are broken with latest development snapshot)
3. Go to admin/build/modules to rebuild your menu_router table
4. Install DTools module and run wsod_emergency.php?q=your_wsod_path page (paste the output)

1. did that, and also cleared cach
2. not using it
3. did that, then run update.php once again,
4. installed dtools 6.x-1.1-rc1. But dtools module doesn't appear along with other modules in admin/build/modules. I've tried the emergency solution described in the README.txt of the module : http://localhost/sites/all/modules/dtools/wsod/wsod_emergency.php didn't work, always stuck with a "page not found" error, nor did http://localhost/crim_ertim/sites/all/modules/dtools/wsod/wsod_emergency... link.

I've even tried the non from Drupal perspective solution described in #5, it actually solved the system.module error, but led to a new one with a message error on admin pages: "You do not have any administrative items."

Now I turned the system.module file to its initial state, and I'm always having the "Unsupported operand types" error and unable to run wsod_emergency.php.

Any clue?

Thank's a lot.

tim-drupal’s picture

Priority: Critical » Normal

Hi,

I've split my #7 comment into a specific new issue to SMS Framework module: #630680:SMS Framework administration menu broken - Fatal error: Unsupported operand types in modules/system/system.module on line 626 and added a comment to this dtools module issue #527888:wsod_emergency.php does not run at all after getting WSOD

Hope it's more relevant.

dkeays’s picture

I have the same problem with some administrative menu items in Ubercart using both Drupal6.14 and 6.15. I did something similar to the work-around listed above; except that I used "ArrayMerge()".

joshuautley’s picture

Same issue as #9. However, I hav enot updated any code. dkeays, please provide details of your work-around for Ubercart. Thanks.

kenorb’s picture

dkeays’s picture

When I said I used array_merge(), my memory was off. According to my notes and the actual code I simply added the mlid key to the associative array. I think the concatenate operator would do the job also, but that is not how I solved the problem. This is only a temporary fix and makes kernel updates a little more difficult. But I don't think my client would be pleased waiting for ubercart and/or the Drupal kernel to be fixed.

system.module lines 627

from:

    $item += db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));

to:

    $item['mlid'] = db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));

I filed a bug report with the system module but apparently some do not feel it is a true core bug. Even though ubercart seems to be calling menus without mlid being set, the core should try to recover without an error or fail gracefully. The line fetches an array which cannot be handled by the PHP operator used. That sounds like a bug to me and needs to be fixed.

Many other modules are having problems with the ml system, ubercart is not alone.

jasonnovember’s picture

I had the same problem with the messaging module. Whenever I clicked on admin link for messaging i got the error, Fatal error: Unsupported operand types ... /modules/system/system.module on line 627.

However, I noticed that after I disabled and uninstalled the messaging module, the menu item was not removed from the administration menu. I manually removed the messaging item from the admin menu. After which I reinstalled the messaging module. Now it works fine.

It looks like it could be a case of faulty uninstallation rather than a core bug.

GuyPaddock’s picture

Please see comment #4 in #785930: Fatal error: Unsupported operand types for my workaround. Definitely something nasty going on in core, methinks.

dkeays’s picture

I agree it is nasty. When I posted an issue about this, an administrator got upset that I called this a bug. His approach was that if a module doesn't call the menu correctly then the core should display a bug. What ever happened to the idea that

#651654: "unsupported operand" in system.module line 627 (seen in administrative menus)

"If the mlid cannot be determined, this function *has to fail* one way or the other (the mlid is used just a few lines below). Failing with a fatal error is not such a bad way to fail."

What ever happened to the idea of failing gracefully?

kenorb’s picture

kenorb’s picture

Status: Active » Closed (duplicate)
c-12’s picture

Status: Active » Closed (duplicate)

This is my first comment on drupal.org and I think it will be helpful :)

I've just finish my upgrade with drupal from 6.16 to 6.17 and I have the same issue with with this /modules/system/system.module on line 627.
Here is what I've did to correct this problem.
1st before upgrading I planned to do backup the whole thing!
2nd I deleted every drupal file and folder except site folder where are mine files and site config.
3rd I've deleted also sites folder in the new drupal 6.17 installation and installed it on the site.
4th After uploading was finished I've turned on every module that was on my drupal 6.16 including module rules.
5th And than boom there is the mentioned error "system.module on line 627" so after that I've restored the drupal database.
6th The final step was the magic update.php.

There problem solved gone forever :)

Something just happens between rules and used drupal database.

And sorry about mine bad English xD it's hard to know 12 languages :-/

kenorb’s picture

c-12: Great! Your English is very good!

dpardo’s picture

It can be solved going to /admin/build/menu-customize/navigation and editing the link for the Simplenews menu item and after saving it...

brayo4’s picture

I installed admin menu module.......fixed it....

Update:
admin menu module should be installed with a lot precaution. It meesed up my menus and had to rebuild them manually......great module but be careful when pushing buttons, it may haunt you later.......

ja09’s picture

dpardo, Thank you so much for your quick solution. (even though it was a year ago :)

I had the exact same issue with Ubercart (admin/store) after upgrading core to 6.22. Just a simple edit to the "Menu link title" fixed the problem.

Anyone know the cause or if there's an underlying problem that needs to be addressed?? Thanks again.

blazetech’s picture

Thank you so much for your quick solution!!!!

FROM:
$item += db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));

TO:
$item['mlid'] = db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));

AFTER ADD IN index.php:
menu_rebuild();

go in your site for rebuild menu and to finish remove menu_rebuild(); from index.php

samhaldia’s picture

Issue summary: View changes

It May be a possibility some of newly developed modules .info file is not proper, may have some improper values