Hi,

Step to reproduce

1)Install entity api module.

2)Install workflow module.

3)created workflow process for document approval.

4)content editor created document and send document for review to moderator.

4)when moderator approve document by update workflow state from review to publish then error comes up.

please find below attached screenshot.

Comments

zied_bhar’s picture

StatusFileSize
new1.06 KB

try this patch

sagannotcarl’s picture

Version: 7.x-1.5 » 7.x-1.6
Status: Active » Needs review
StatusFileSize
new973 bytes

#1 worked for me. Here is a reformatted patch.

djik’s picture

#1 worked for me too ^^

mpotter’s picture

Status: Needs review » Reviewed & tested by the community

This 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..

The last submitted patch, 1: entity.inc_.patch, failed testing.

chrisroane’s picture

I 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!

fago’s picture

Status: Reviewed & tested by the community » Needs work

I 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.

risla’s picture

I also got the error with the version 7.x-1.8 and needed to patch it accordingly.

antiorario’s picture

The 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):

Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize in DrupalDatabaseCache->set() (line 455 of [path]/includes/cache.inc).

antiorario’s picture

I 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_collector saved by TestingMailSystem::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.

minoroffense’s picture

Small reroll to make git happy.

kpoornima’s picture

Status: Needs work » Reviewed & tested by the community

Path #11 working as expected. Applied patch did n't get fatal error.