Getting the error "Fatal error: Unsupported operand types in content_profile.module on line 80".
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(
'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; // <- line 80 here
}
}
Are you sure that $item is an array?
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | content_profile-580086.patch | 1.49 KB | alexpott |
Comments
Comment #1
milos.kroulik commentedJust got this error during database update of other modules. Could it be some interference?
Updated modules were:
Comment #2
paoloteo commentedconfirming... same issue here.
Only module we have update in common is: Nodewords [nodewords-6.x-1.3-beta4]
Comment #3
jennycita commentedSame problem... my only updated module was:
XML sitemap [xmlsitemap-6.x-1.1]
I used drush to update, if that makes any difference.
Everything worked fine when I disabled content_profile and content_profile_registration, updated xmlsitemap, and then re-enabled content_profile and content_profile_registration.
Comment #4
lyricnz commentedSame problem here, no nodewords module in place. The code in question is:
with the "+ $item" being line 80. Clearly $item is not an array at that time. You could suppress the error by checking for is_array() before attempting to add to $item.
Comment #5
lyricnz commentedLooks like similar issue discussed (and fixed) in #362036: Fatal error: Unsupported operand types in content_profile.module.
Comment #7
finex commentedI've had this error updating "Alter profile page" module from 6.x-2.3 to 6.x-2.5.
I'm using drupal 6.14, content profile 6.x-1.0-beta4 and cck 6.x-2.6.
I've used drush for the update.
Comment #8
briandj62 commentedJust issued drush update command. After updating skinr, I got the following error:
I am using Drupal 6.15.
I have no idea whether there is any relation between the two modules.
Comment #9
butler360 commentedI get this whenever I do any updates with drush.
Comment #10
briandj62 commentedI also get this error whenever I update with drush:
And the worst is that now the Administer > User Management page (admin/user) is blank (although I can still navigate to the menu items below that page).
Any ideas/fixes?
Comment #11
lyricnz commentedbriandj62: as explained in the issue linked in #5, this was fixed (in dev) in August, but there hasn't been a new release since then.
#362036: Fatal error: Unsupported operand types in content_profile.module
You'll either need to run the -dev version of Content Profile (in red on http://drupal.org/project/content_profile ), or apply this change manually.
Comment #12
butler360 commentedI have the dev version installed and still get the error.
Comment #13
lyricnz commentedWhat *date* is your -dev version?
Comment #14
butler360 commentedSorry, by dev version I meant the latest (Jan 13).
Comment #15
sandy121 commentedUnsupported operand types in content_profile.module on line 430
function content_profile_get_settings($type, $return = 'all') {
$settings = variable_get('content_profile_'. $type, array());
$settings += content_profile_settings_info(); ////////// line 430
if ($return == 'all') {
return $settings;
}
return $settings[$return];
}
Comment #16
alberto56 commentedSame here, this error occurs only with drush updates of non-related modules. Perhaps adding some type checking might do the trick.
Comment #17
alberto56 commentedActually, this problem prevents dabatase updates using drush. On sites with this version of of content profile, I use this drush code to update by database and it works:
Comment #18
alexpottI get the line 80 error whilst updating other modules using drush. It is occurring because $items['user/%user_category/edit/'. $type] is not an array yet.
I am using the dev version of content_profile as of 2010-Mar-26.
I thought this might be because the user module has not created the menu items as a result of the call to content_profile_user do get the categories. I noticed that the weight of the content_profile module is -1 and the weight of the user module is 0 so I tried changing the weight of content_profile to 1 to see if this would fix it. It did not.
So the only fix I can think of is to check if $item is an array before doing the operation... patch attached... it eliminates the error when upgrading a module / your site using drush.
Comment #19
alberto56 commented#18 seems to suggest that this error is not, in fact, a duplicate (the error occurring even with the recent dev version). I haven't had a chance to test the patch but I will nonetheless set back to active.
Comment #20
fagook. This shouldn't happen as content profile alters $items, so I guess there is an underlying bug somewhere. Anyway, I commited a check to prevent to throw errors in that case.