I've went to admin/build/modules and I've got following error:

Fatal error: Unsupported operand types in D:\bro\workspace\Websites\XComKids\trunk\sites\all\modules\contributions\content_profile\content_profile.module on line 75

Line 75:

    $item = array(
      'page callback' => 'content_profile_page_edit',
      'page arguments' => array($type, 1),
      'access callback' => 'content_profile_page_access',
      'access arguments' => array($type, 1),
      'file' => 'node.pages.inc',
      'file path' => drupal_get_path('module', 'node'),
    ) + $item;
CommentFileSizeAuthor
#7 array_operand.patch898 bytesmonan

Comments

kenorb’s picture

In content_profile_menu_alter()

kenorb’s picture

Status: Active » Postponed (maintainer needs more info)

Probably it's because some module called menu_alter hook with different arguments.

function content_profile_menu_alter(&$items) {
  foreach (content_profile_get_types('names', 'edit_tab', 'sub') as $type => $type_name) {
    $item = &$items['user/%user_category/edit/'. $type];
    $item = array(

And content profile getting $items['user/%user_category/edit/'. $type] variable without checking what was passed through.
I don't know if this can stay like that or there should be some changes done in the code.

fago’s picture

hm, usually this has to work. Why should another module call menu_alter again with different arguments? That sounds bad. Can you reproduce this with a clean drupal install + content profile? If not, try to identify the module causing the problem once activated.

kenorb’s picture

Status: Postponed (maintainer needs more info) » Postponed
halfiranian’s picture

Status: Postponed » Active

Any more news on this error? When I go to the register page I get this:

Fatal error: Unsupported operand types in /XXX/sites/all/modules/content_profile/modules/content_profile_registration.module on line 185

I'll try and see what module is causing it but any pointers appreciated!

halfiranian’s picture

Status: Active » Postponed

it was vertical tabs module doing this for me, in case others want to know

monan’s picture

StatusFileSize
new898 bytes

I'm seeing this error as well on one of the sites I'm currently working on:

Fatal error: Unsupported operand types in /XXX/sites/all/modules/content_profile/modules/content_profile_registration.module on line 186 (this is function content_profile_registration_alter_weights()).

This occurs when trying to go to the /user/register screen.

PHP version: PHP 5.2.4-2ubuntu5.6 with Suhosin-Patch 0.9.6.2

This looks similar to the problem mentioned at: http://drupal.org/node/180137.

My fix is to move away from the '+=' operand here:
$elements[$key] += array('#weight' => 0);
and, instead, rely on an equivalent:
array_push($elements[$key], array('#weight' => 0));

This fixes the problem.

Patch is included...

Thanks!

monan’s picture

Component: Base module » User registration module
Status: Postponed » Needs review

Sorry... Didn't update the issue flags... See comment #7 for what these flags apply to...

fago’s picture

Status: Needs review » Fixed

hm, that code is not equivalent. Anyway I improved the code by adding an additional check, so the errors should be fixed now.

monan’s picture

Whoops... Got me there... I guess it was pretty late... Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jamesmcd’s picture

Have the amendments been applied to the latest stable release?

I'm using version 6.x-1.0-beta4 and I've just had the error come up as as described by monan in #7

If they have not been applied, should I go ahead and use the dev version?

lyricnz’s picture

jamescmd: beta4 is from June 15, and it looks like fago fixed it in August. Until a new release is made, either use the dev release, or apply this change manually

http://drupalcode.org/viewvc/drupal/contributions/modules/content_profil...

skizzo’s picture

I am using 6.x-1.x-dev (2010-01-13) but I am still getting the following (apparently harmless) error on drush update some-other-module

Fatal error: Unsupported operand types in /var/www/drupal/sites/all/modules/content_profile/content_profile.module on line 80

kewlguy’s picture

#skizzo:

I believe there is some discussion and a patch for using Drush to update modules and then getting this error.

Check it out here