Reviewed & tested by the community
Project:
Entity API
Version:
7.x-1.6
Component:
Code - misc
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jun 2014 at 08:47 UTC
Updated:
27 Apr 2023 at 08:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
zied_bhar commentedtry this patch
Comment #2
sagannotcarl commented#1 worked for me. Here is a reformatted patch.
Comment #3
djik commented#1 worked for me too ^^
Comment #4
mpotter commentedThis really does need to get committed. Wasted several hours trying to track down this problem with entity and simpletest.
The issue here is that during the Initialize Variables part of the bootstrap, Drupal calls unserialize on the variables to load them into memory. Entity API has a __wakeup hook that calls setUp(). However, at this early point of the bootstrap, the common.inc file isn't loaded yet (which contains the entity_get_info() function).
There is a related issue here #1722636: drupalPost() fail to pass entity data on form submit..
Comment #6
chrisroane commentedI just spent 8 hours trying to track down an issue that was related to this. Applying the patch from #2 fixed this for us. This really needs to get committed!
Comment #7
fagoI don't think it is safe to commit this, as the object would be not properly set up and thus not work correctly. I think the best we can do is generating a better error message to point the developer to the root of the problem. Alternatively, we'd have to improve the class to lazily fetch the needed stuff but that might not be possible in a BC manner.
Comment #8
risla commentedI also got the error with the version 7.x-1.8 and needed to patch it accordingly.
Comment #9
antiorario commentedThe patch at #2 works, but then I start getting this error message (not always, and not on all pages—I will look for a pattern):
Comment #10
antiorario commentedI was snooping around for similar issues, and found #1049104: Fatal error: Call to undefined function entity_get_property_info(), where I found a possible culprit: an entity wrapper saved in a variable, which ended up trying to call entity_get_info() too early in the bootstrap process. I found the variable (in my case, the variable
drupal_test_email_collectorsaved byTestingMailSystem::mail()). I manually deleted the variable and truncated the cache tables, and the problem disappeared without any need for patches. I hope this helps troubleshooting the issue.Comment #11
minoroffense commentedSmall reroll to make git happy.
Comment #12
kpoornima commentedPath #11 working as expected. Applied patch did n't get fatal error.