I am getting a fatal error after installing Drupal Commerce:
Drush command terminated abnormally due to an unrecoverable error.
Error: Unsupported operand types in .../sites/all/modules/contrib/entity/views/entity.views.inc, line 189
I'm not able to run xdebug where I'm encountering the error, but with var_dump I've narrowed it down to entity_views_field_definition in entity.views.inc. It's a helper function used to generate data for hook_views data(). (Function definition is: entity_views_field_definition($field, array $property_info, array &$table, $title_prefix = '') .)
The function is passed NULL for $property_info and blows up on line 189, which assumes an array. I assume this is bad data coming from commerce install, but haven't been able to nail it down yet.
It seems to have been an issue with Commerce for a while:
#1480106: "unexpected error" crash site when activate order
#1361562: Re-enabling Commerce causes a PHP Fatal Error
While I haven't found the source, I have been able to fix it by adding a check to the beginning of entity_views_field_definition() and returning if the property_info is not set. I know the helper functions assume data is good, but a little data check doesn't hurt.
Comment | File | Size | Author |
---|---|---|---|
#11 | unsupported-operands-2136919-11.patch | 486 bytes | eric.chenchao |
#2 | unsupported-operands-2136919-2.patch | 618 bytes | cleaver |
Comments
Comment #1
cleaver CreditAttribution: cleaver commentedComment #2
cleaver CreditAttribution: cleaver commentedComment #3
Sylvain Lecoy CreditAttribution: Sylvain Lecoy commentedComment #4
cleaver CreditAttribution: cleaver commentedThanks Sylain, I'll test your patch in #2122389: Views handler not working properly throwing warnings at cache flushing...
Comment #5
cleaver CreditAttribution: cleaver commentedJust realized also... when I rolled my patch in #2, I did it from the root of my project, not from the module. So, it won't apply with drush make. Just a one-liner, but I may reroll if the related patch doesn't work for me.
Comment #6
cleaver CreditAttribution: cleaver commentedThe patch in the related issue fixes this problem.
See: #2122389: Views handler not working properly throwing warnings at cache flushing...
Comment #7
Sylvain Lecoy CreditAttribution: Sylvain Lecoy commentedDo not hesitate to put the issue as RTBC (Reviewed and Tested By the Community). This will help commit this patch rapidly.
Cheers!
Comment #8
cleaver CreditAttribution: cleaver commentedI still seem to be able to get the error, even with patch from #2122389: Views handler not working properly throwing warnings at cache flushing.... It is not a regular problem, but happened when I moved a database from one server to another.
Comment #9
joelpittet#2 solves the error for me. It would be good to know maybe what is sending in an empty $property_info to begin with?
Comment #10
eric.chenchao CreditAttribution: eric.chenchao commentedIt also happens in the newer version.
Comment #11
eric.chenchao CreditAttribution: eric.chenchao commentedHave updated patch path from a/sites/all/modules/contrib/entity to a.
Comment #12
jwjoshuawalker CreditAttribution: jwjoshuawalker commentedStill happens.
I don't know the full extent of how/why etc but this is all I did:
Had site A and site B as a duplicate copy.
Using drush sql-sync to copy DB from A to B periodically.
Everything was fine until commerce was installed, then this error.
Patch in #11 makes the site usable again.
Comment #14
Pls CreditAttribution: Pls commentedPatch from #11 works great.
Comment #15
jruadh CreditAttribution: jruadh commentedAfter cloning my site from my server to my local drive, the patch from #11 worked. Followed by clearing all caches.
Comment #16
Pls CreditAttribution: Pls commentedComment #17
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedEdit: sorry, this was meant for another post. My apologies for the clutter. And yes it seems to work for me too
this is already included in the latest dev version
Comment #18
joelpittet@SocialNicheGuru #11 is not included in the latest dev. The patch just applied cleanly against the latest git repo.
Still RTBC.
Comment #19
fagoThis should not happen, it's probably caused by some cache rebuilding issue.
Is everything working correctly after #11 being applied? I'm a bit hesitant to just ignore this is this might be important to show that something is wrong. I.e. we could even throw an exception instead?
Comment #20
mgiffordIt is a totally simple patch. However, I'm having trouble replicating the problem on a fresh install. If Drupal Commerce is installed with Drush does it always provide this error?
I'd like to be able to reproduce this error to see that this isn't just a cache issue.
Comment #21
crimsondryad CreditAttribution: crimsondryad commentedI'm seeing this too, it popped for me while enabling the google charts module. And also in other stuff related to commerce, it looks like maybe commerce_order. I haven't had a chance to try to dig in further, obviously this isn't a clean install.
Patch prevented the error for me. How would we go about finding out if there is a deeper issue?
Comment #22
Louis Delacretaz CreditAttribution: Louis Delacretaz as a volunteer and commentedI was having the same fatal error at flag/includes/flag/flag_flag.inc on line 132, fixed it by rolling back the database
and started getting this error at entity/views/entity.views.inc on line 189.
Manually clearing the cache table fixed the error for me.
I had been setting up memcached on the server which could be the cause of corrupted cache table.
Hope that helps in the digging for a root cause.