Closed (fixed)
Project:
Entity API
Version:
7.x-1.x-dev
Component:
Core integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Dec 2010 at 22:09 UTC
Updated:
31 Jan 2011 at 12:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
mcfilms commentedSame error after update although it is on line 20 now. I might add that I am also getting an error when I reload any page now:
Comment #2
sunPlease make sure that you run on latest versions of both modules/code.
Comment #3
mcfilms commented@sun -- I am running the very latest with this issue:
rules-7.x-2.x-dev.
entity-7.x-1.x-dev
drupal-7.0-rc2
I still get:
I realize that although my error points at the Entity API, the cause can be any one of a number of external factors. I didn't see any documentation about known incompatibilities.
I have these additional D7 modules:
admin_menu
backup_migrate
ctools
entity
google_analytics
image_resize_filter
imce
imce_wysiwyg
pathauto
preset
rules
superfish
token
video
views
wysiwyg
What would you suggest my next step be? Should I recreate this error on a brand new environment and then share access to it?
Comment #4
sunYou also need latest Drupal HEAD.
Comment #5
mcfilms commentedI can report the exact same experience under Drupal core 7.x-dev from 2010-Dec-17.
This shows up when I visit the modules page:
Can we just take a look at line 20 and the operand again?
Should that be a plus sign? I grant that my php skills are puny, but "+" doesn't look right. Maybe I'm just grasping at straws.
Comment #6
wjaspers commentedI can cause it, too.
Fatal error: Unsupported operand types in sites\all\modules\entity\modules\field.info.inc on line 20It seems to be happening AFTER the node is saved.
I have a feeling this is triggered by upgrading the Token module.
My order of events
I'm willing to bet on #5's explanation, too:
field_info_field_types($field['type'])looks as if it should return a BOOL.If this is the case,
bool + arraycannot work.If it is returning an array
array + arrayclaims to be PHP4 and 5 compatible. (see: http://us3.php.net/manual/en/language.operators.array.php ).I have a strong feeling
array + arraywas an undocumented improvement to early versions of PHP5. It may look wrong, but it is actually a form ofarray_merge. Nonetheless, this error shouldn't occur, since I'm using the most recent PHP5 version anyway.Comment #7
wjaspers commentedRead up on the
field_info_field_typesin Core. Looks like if afield typeis provided, aSTRINGis returned; which WILL cause the expression identified to FAIL in PHP.This can be overcome by putting the output of
field_info_field_typesinto an array with a key that needs to be placed in the other side of the expression; OR ... improving the naming of hooks so they're not as easily misused.See: CORE/modules/field/field.info.inc @ line 471
Comment #8
fagoIt returns the field type info array, thus the array+array operand is fine. But maybe the field-type in question is not available any more as the module is deactivated, thus the error is triggered?
Comment #9
fagoThe attached patch should fix it. Please test.
Comment #10
fagoAt least the additional check won't harm, so I've just committed #9.