Pretty much the title says it all.
This is a fresh installation - no modules, no nothing. Just as it is from http://ftp.drupal.org/files/projects/drupal-7.12.tar.gz.
And it's running on:
Apache 2.2.10
PHP 5.3.6
PostgreSQL 8.3.5
Slackware 11

Comments

berdir’s picture


function system_admin_menu_block($item) {
  $cache = &drupal_static(__FUNCTION__, array());
  // If we are calling this function for a menu item that corresponds to a
  // local task (for example, admin/tasks), then we want to retrieve the
  // parent item's child links, not this item's (since this item won't have
  // any).
  if ($item['tab_root'] != $item['path']) {
    $item = menu_get_item($item['tab_root_href']);
  }

  if (!isset($item['mlid'])) {
    $item += db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = :path AND module = 'system'", array(':path' => $item['path']))->fetchAssoc();
  }

$item +=... is line 2107.

Sounds like it fails to load the menu item, are you sure that your installation didn't abort or something like that? *Something* must have gone wrong for you, looks like you're the first one to report this.

Try to re-install into a clean database and check if you still experience this bug? Does it also happen when you are using MySQL or SQlite?

filijonka’s picture

well purely technicly adding arrays with += is wrong and db_query()->fetchassoc always do return an array(?).
we do though use this construction on other places without problem.

so if Berdirs suggestion doesn't help perhaps we should see if changing that line to a more correct way of adding an array to another will help.

berdir’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs steps to reproduce

As per xjm's instructions (thanks!), I'm changing this to an un-critical support request until this has been confirmed and can be reproduced by someone else.

Please provide more information as requested in #1 and detailed steps to reproduce this, starting from the installer.

vivdrupal’s picture

Working on MySql -

Fatal error: Unsupported operand types in ....\modules\system\system.module on line 2107
while trying to access
/admin/commerce/products/add

spgd01’s picture

I get this error when trying to go to admin/config/messaging

naveenk.php’s picture

Unsupported operand types in ..........l/drupal/modules/system/system.module on line 2107

i am also got this error

balagan’s picture

I also got similar error with a new install, using PHP/5.4.10, Apache and Postgresql 9.2.1 as a database.
The error pointed to: htdocs\\drupal\\includes\\theme.inc on line 1071,

I got the same error with xampp (mysql). Just install ctools plugin example clicking its menu item gives this error (http://localhost/drupal/admin/settings/ctools_plugin_example)

maerys’s picture

Same here with the Commerce module. When hitting the store button the error appears...

Paul B’s picture

Version: 7.12 » 7.22
Status: Postponed (maintainer needs more info) » Active

This test module will trigger this error:

/**
 * Implements hook_menu
 */
function test_menu() {
  $items['admin/structure/test'] = [
    'title' => 'Test page',
    'page_callback' => 'test_page',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  ];
  return $items;
}

function test_page() {
  return 'test';
}

As it's a MENU_CALLBACK it's not in the menu_links table.

Paul B’s picture

Issue summary: View changes

( ! ) Fatal error: Unsupported operand types in /.../drupal-7.12/modules/system/system.module on line 2107
Call Stack
# Time Memory Function Location
1 0.0013 327372 {main}( ) ../index.php:0
2 0.4324 15915112 menu_execute_active_handler( ) ../index.php:21
3 0.4487 16701600 call_user_func_array ( ) ../menu.inc:517
4 0.4487 16701732 system_admin_menu_block_page( ) ../menu.inc:517
5 0.4488 16701732 system_admin_menu_block( ) ../system.admin.inc:68

jochen wendebaum’s picture

Issue summary: View changes

Same error as in #4 here, too.

Changing line 2128 from $item += db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = :path AND module = 'system'", array(':path' => $item['path']))->fetchAssoc(); to $item = array_merge ( $item, db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = :path AND module = 'system'", array(':path' => $item['path']))->fetchAssoc()); could solve that problem if I would dare to change that file.

filijonka’s picture

Hi @jochen

We need more information, we need steps to be able to reproduce this Based on your comment this is an error in commerce module and not in core, have you reported this in commerce module issue queue?

jochen wendebaum’s picture

Well, no.

This is a strange issue, because by searching this issue for some hours, the solution was to rearrange entries in the management menu. Now the error has disappeared.

Nevertheless, there seems to be some issue with this part of the code, as a wrongly arranged management menu it appears again.

gbyte’s picture

Hi Jochen, facing the same issue here. How exactly did you rearrange the items to fix the issue?

Madhura BL’s picture

Hi, I have the same problem with the Commerce module. When hitting the store button the error appears...
@gbyte.co, were you able to find a fix for this? please help

shablm’s picture

cleared the cache_menu table, disabled and re-enabled the menu module, Error gone :)

gbyte’s picture

@madhura_bl, this did not work for me including disabling all commerce and menu related modules and clearing all caches.
What did work for me however, was simply editing the broken link and clicking save. Don't have time resources to investigate ATM, maybe in the future.

land0’s picture

@madhura_bl your solution worked for us. Thank you. :)

marko b’s picture

#14 didnt work for me

cilefen’s picture

@Marko B Since this is an old issue, could you please detail the steps you took and the error message in full?

marko b’s picture

It's pretty simple. I have DC installed, I go to http://site.local/admin/commerce and I just get this error, this is on different setups, computers and servers.
Rest of the pages are fine. All working, just this link above is crashing.

cilefen’s picture

Title: Fatal error: Unsupported operand types in /.../drupal-7.12/modules/system/system.module on line 2107 » Fatal error: Unsupported operand types in /.../drupal-7.12/modules/system/system.module on line 2107 when loading commerce admin menu paths
Project: Drupal core » Commerce
Version: 7.22 »
Component: system.module » Code
Category: Support request » Bug report

I cannot reproduce the error.

I am moving this to the commerce module queue since that is what seems to be the issue. Please put the steps to reproduce in the issue summary.

bember’s picture

It seems that this happen because router_path != link_path on some commerce links. I have fixed the problem by running the following code:

  db_update('menu_links')
    ->expression('router_path', 'link_path')
    ->condition('menu_name', 'management')
    ->condition('link_path', db_like('admin/commerce') . '%', 'LIKE')
    ->where('link_path <> router_path')
    ->execute();
Nkendall’s picture

I ran #22 in devel execute php and that solved the problem for me.

Nkendall’s picture

So, now this error started popping up after running the code in #22.

Undefined index: menu-store-products in menu_tree_build() (line 524 of C:\Users\Nick\Sites\devdesktop\psr3\sites\all\modules\menu_block\menu_block.module).

. Might have further diagnostic utility.

Nkendall’s picture

Happens with update to 7.43, # 22 still fixes it.