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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Déja’s picture

Status: Active » Needs review
FileSize
551 bytes

Status: Needs review » Needs work

The last submitted patch, workbench_moderation-undefined-property-1238428.patch, failed testing.

becw’s picture

Priority: Major » Normal
Status: Needs work » Postponed (maintainer needs more info)

Dé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.

Déja’s picture

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

stevector’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

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

Elin Yordanov’s picture

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

I suspect it is the result of node caching

has given me the light, since I had the 'Entity Cache' module installed. After disabling Entity Cache the notices are gone away.

dend01’s picture

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

dend01’s picture

A 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).

emudojo’s picture

same 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).

iLLin’s picture

Issue summary: View changes

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

function workbench_access_node_presave($node) {
  // We must have a node id to continue. @see workbench_access_node_insert().
  if (empty($node->nid)) {
    return;
  }
  // Load full Node object
  $node = node_load($node->nid);

There may be a better method, so not providing a patch yet.

iLLin’s picture

Status: Closed (cannot reproduce) » Active
iLLin’s picture

Project: Workbench Moderation » Workbench Access

And the module in question is Workbench Access, so moving this issue.

giri99’s picture

I got the same error, is there any update with the issue??

vids’s picture

I got the same error while I updated the module 1.4

Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined property: stdClass::$is_current in workbench_moderation_node_data() (line 1230 of /mnt/www/html/example.com/docroot/sites/all/modules/workbench_moderation/workbench_moderation.module).

agentrickard’s picture

Project: Workbench Access » Workbench Moderation
Version: 7.x-1.0-beta8 » 7.x-1.4

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: workbench_moderation-undefined-property-1238428.patch, failed testing.

rabithk’s picture

Hello ,
Still issue exist . Any patch for this issue fix .
Thank you .
Rabith

anthony0perez’s picture

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

giri99’s picture

I just revert back to the 1.3, it no longer shows the error message.

Pepper’s picture

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