#972536: Object of class stdClass could not be converted to int in _menu_router_build() - line 3370 describes a behaviour in Drupal where PHP's array_multisort() sometimes uses the menu item definitions themselves as a secondary sorting mechanism. This can sometimes cause the menu item definitions, which are complex structures, to be used as sorting keys, and trigger an error like:

Object of class stdClass could not be converted to int in _menu_router_build()

Although commerce_addressbook's usage of hook_menu() works fine in most cases, under certain circumstances it will trigger the above error.

The Nodequeue project had a similar problem which was fixed by this commit.

Proposed course of action

Move the callback arguments to the end of the menu item definition in hook_menu, as per this comment on the hook_menu() API page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alberto56 created an issue. See original summary.

alberto56’s picture

Status: Active » Needs review
FileSize
2.95 KB

Here is a patch which implements the workaround.