This error pops up on the Moderation tab and prevents the moderation interface from being displayed. I suspect it is the result of node caching, since it goes away when the caches are cleared, but will pop up again after about 5-10 minutes of content editing on the site. In situations where this error arises, hook_node_load() is not being called, which means that $node->workbench_moderation is not set. It appears that the vast majority of functions assume that hook_node_load() is being called every time, because they do not call workbench_moderation_node_data() and they do not check to make sure that $node->workbench_moderation exists before trying to use it.
While this may only be treating the symptom of a deeper issue, I've rolled the attached patch, which addresses this specific situation (node_history_view()). Since installing it I have not run into any other such errors on my own sites, but I think it might be worthwhile to do a bit more property checking and/or error handling.
Comment | File | Size | Author |
---|---|---|---|
#1 | workbench_moderation-undefined-property-1238428.patch | 551 bytes | Déja |
Comments
Comment #1
Déja CreditAttribution: Déja commentedComment #3
becw CreditAttribution: becw commentedDéja, can you describe how to make this bug happen? It seems like your patch will address the issue you describe, but I'm wary of working on an issue I can't duplicate--I never know when it's fixed :)
Also, I don't know what's up with the tests. It looks broken in ways that are unrelated to the patch you posted.
Comment #4
Déja CreditAttribution: Déja commentedThe only site I've encountered this issue on was one in which I had migrated several thousand nodes across a half-dozen content types from Drupal 5 into Drupal 7. I have not had an opportunity to try to recreate it on a clean install.
Comment #5
stevectorI'm going to close this because we haven't gotten any other reports of the problem and cannot reproduce it. Please re-open if you see it again.
Comment #6
Elin Yordanov CreditAttribution: Elin Yordanov commentedI had a similar issue today and I come up to this page. Although no solution is posted since the issue was not reproducable, the statement of the OP:
has given me the light, since I had the 'Entity Cache' module installed. After disabling Entity Cache the notices are gone away.
Comment #7
dend01 CreditAttribution: dend01 commentedI've had the exact same error. The notices only go away once I clear my caches. But they inevitably come back. I'm not sure what to do to. Any suggestions would be much appreciated.
Comment #8
dend01 CreditAttribution: dend01 commentedA little more precision. I usually get a series of error messages. Here are some examples:
Notice: Undefined property: stdClass::$workbench_moderation in _workbench_moderation_access_current_draft() (line 570 of /home/vg007web05/14/65/2016514/web/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$workbench_moderation in workbench_moderation_view_tab_title() (line 337 of /home/vg007web05/14/65/2016514/web/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$workbench_moderation in _workbench_moderation_access_current_draft() (line 570 of /home/vg007web05/14/65/2016514/web/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$workbench_moderation in workbench_moderation_edit_tab_title() (line 305 of /home/vg007web05/14/65/2016514/web/sites/all/modules/workbench_moderation/workbench_moderation.module).
Comment #9
emudojo CreditAttribution: emudojo commentedsame here, while using MSSQL weird
Notice: Undefined property: stdClass::$workbench_moderation in workbench_moderation_view_tab_title() (line 337 of C:\inetpub\wwwroot\site\sites\all\modules\contrib\workbench_moderation\workbench_moderation.module).
Notice: Undefined property: stdClass::$workbench_moderation in _workbench_moderation_access_current_draft() (line 570 of C:\inetpub\wwwroot\site\sites\all\modules\contrib\workbench_moderation\workbench_moderation.module).
Notice: Undefined property: stdClass::$workbench_moderation in workbench_moderation_edit_tab_title() (line 305 of C:\inetpub\wwwroot\site\sites\all\modules\contrib\workbench_moderation\workbench_moderation.module).
Comment #10
iLLin CreditAttribution: iLLin commentedUsing views bulk operations, it does not load the full node into the $node variable during the presave function. To fix this issue, we need to load the node object manually. This can be fixed like so to start on line 657.
There may be a better method, so not providing a patch yet.
Comment #11
iLLin CreditAttribution: iLLin commentedComment #12
iLLin CreditAttribution: iLLin commentedAnd the module in question is Workbench Access, so moving this issue.
Comment #13
giri99 CreditAttribution: giri99 commentedI got the same error, is there any update with the issue??
Comment #14
vids CreditAttribution: vids commentedI got the same error while I updated the module 1.4
Comment #15
agentrickardComment #18
rabithk CreditAttribution: rabithk commentedHello ,
Still issue exist . Any patch for this issue fix .
Thank you .
Rabith
Comment #19
anthony0perez CreditAttribution: anthony0perez as a volunteer commentedDoes number #17 patch work? This is still going on. This didn't happen on a test version of the same site that it is working on.
Comment #20
giri99 CreditAttribution: giri99 as a volunteer commentedI just revert back to the 1.3, it no longer shows the error message.
Comment #21
Pepper CreditAttribution: Pepper commentedI'm getting this same error on an upgrade to 1.4
Notice: Undefined property: stdClass::$current in workbench_moderation_node_data()
as well as
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230
Clearing caches to see if it'll continue to be an issue...