Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I enable Entity and then enable Rules and then return to the modules page I get:
Fatal error: Unsupported operand types in /home/everlast/public_html/take5/sites/all/modules/entity/entity_metadata/modules/field.info.inc on line 19
For what it's worth that line is:
$field_type = field_info_field_types($field['type']) + array('property_callbacks' => array());
This is with rules-7.x-2.0-alpha3 and Entity 7.x-1.0-beta3. I'm going to try the dev version now.
Comment | File | Size | Author |
---|---|---|---|
#9 | entity-field_type.patch | 1.72 KB | fago |
Comments
Comment #1
mcfilms CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: wjaspers commentedI can cause it, too.
Fatal error: Unsupported operand types in sites\all\modules\entity\modules\field.info.inc on line 20
It 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 + array
cannot work.If it is returning an array
array + array
claims to be PHP4 and 5 compatible. (see: http://us3.php.net/manual/en/language.operators.array.php ).I have a strong feeling
array + array
was 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 CreditAttribution: wjaspers commentedRead up on the
field_info_field_types
in Core. Looks like if afield type
is provided, aSTRING
is returned; which WILL cause the expression identified to FAIL in PHP.This can be overcome by putting the output of
field_info_field_types
into 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.