I got this error on my dev site when trying to run the migrate UI (didn't get the error on my local machine):
Fatal error: rules_invoke_event(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "RulesEventSet" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in ../sites/default/modules/migrate_reviews/reviews.inc on line 239
The code on line 239 is inside the complete() function:
votingapi_add_votes(&$votes);
When I disable rules I don't get the error. Strange ...
Comments
Comment #1
mikeryanWhat if you require() the rules file that defines RulesEventSet before that line in your code?
Comment #2
mototribe CreditAttribution: mototribe commentedThe error went away after I disabled rules and re-enabled it again. Thanks
Comment #2.0
mototribe CreditAttribution: mototribe commentedadded complete()
Comment #3
davidwbarratt CreditAttribution: davidwbarratt commentedI created a custom module using Multi-step forms. The custom form loads the Node Form using node_form(), makes some customizations and uses the node form as the multi-step form.
This was all working perfectly on my local machine without any problems at all. However, when I put the code on the live server, I received the following error:
Since I got a similar error in a completely different context, I'm assuming this has nothing to do with Migrate and instead has to do with Rules.
The only way I was able to fix this has been to put this code in my page callback:
I know that is disgusting. It's re-building the Event Cache every time my form is loaded. That was the only way I could get it to work. I discovered this by clearing the Drupal cache. When I did that, I was able to load my form exactly 1 time. Refreshing the page caused the PHP error.
I'm still unable to duplicate this problem on my local machine, or provide replication steps. It seems that this is specific to the server/system configuration. If there's anything I could provide to help troubleshoot the issue please let me know, I'd like to stop using the above hack as soon as possible.
Thanks!
Comment #4
davidwbarratt CreditAttribution: davidwbarratt commentedI'm not sure if this helps, but Line 73 (the line that invoked the PHP Error) of my custom module is:
Thanks!
Comment #5
TR CreditAttribution: TR commentedCan you try the patch in #1541888: PHP warnings when calling method RulesEventSet::rebuildEventCache() and see if it fixes things for you? I think that may address the root cause of the error you're seeing.
Comment #6
TR CreditAttribution: TR commentedNo response and no steps to reproduce.