I have written a custom module that creates certain nodes in bulk based on certain node types and other conditions. After installing revisioning, I get these messages when I run my bulk create operation. I've traced my code, and the problem seems to occur during node_save(), which is being performed on nodes selected with node_load() and a SQL query.

Notice: Undefined property: stdClass::$nid in revisioning_set_node_revision_info() (line 41 of ... revisioning_api.inc).
Notice: Undefined property: stdClass::$nid in revisioning_set_node_revision_info() (line 42 of ... revisioning_api.inc).
Notice: Undefined property: stdClass::$vid in revisioning_revision_is_current() (line 112 of ... revisioning_api.inc).
Notice: Undefined property: stdClass::$vid in _revisioning_node_is_pending() (line 159 of ... revisioning_api.inc).

Comments

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed

Fixed and released as part of 7.x-1.0-beta5.

chrisgross’s picture

I've updated to beta5 and I am still seeing these errors. I also was/am seeing this one, too.

Notice: Undefined property: stdClass::$nid in revisioning_node_presave() (line 448

chrisgross’s picture

Also, since this update, the edit tab for editing a node, now says "Revisions". So there are two revisions tabs.

EDIT: *This* issue mysteriously vanished after enough cache clears, but the main problem related to this ticket still exists.

rdeboer’s picture

Ok will look into it. Thanks for reporting it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chrisgross’s picture

Version: 7.x-1.0-beta7 » 7.x-1.0-beta3

I am seeing these errors again. It looks like during node_presave, the revisioning_set_node_revision_info() function is being called, which is relying on an nid that doesn't exist.

Notice: Undefined property: stdClass::$nid in revisioning_set_node_revision_info() (line 41 of /local/www/vhosts/www_gps/sites/all/modules/revisioning/revisioning_api.inc).
Notice: Undefined property: stdClass::$nid in revisioning_set_node_revision_info() (line 42 of /local/www/vhosts/www_gps/sites/all/modules/revisioning/revisioning_api.inc).
Notice: Undefined property: stdClass::$nid in revisioning_set_node_revision_info() (line 41 of /local/www/vhosts/www_gps/sites/all/modules/revisioning/revisioning_api.inc).
Notice: Undefined property: stdClass::$nid in revisioning_set_node_revision_info() (line 42 of /local/www/vhosts/www_gps/sites/all/modules/revisioning/revisioning_api.inc).
Status message
Initial revision created and published.
Initial revision created and published.

If everything is still going to function normally regardless of these notices, just suppressing those messages when there is no nid would be nice.

chrisgross’s picture

Version: 7.x-1.0-beta3 » 7.x-1.0-beta7
Status: Closed (fixed) » Active
rdeboer’s picture

Version: 7.x-1.0-beta3 » 7.x-1.0-beta7

Absolutely. This should be an easy one.

rdeboer’s picture

Status: Active » Fixed

Fixed in 7.x-1.0-beta8

chrisgross’s picture

This seems to work just fine. Is there any way I can get this update outside of beta8? beta7 works great with my custom tweaks in place for issue http://drupal.org/node/1174846, but beta8 hosed everything up. I would like to get this particular fix in place on my site and then move on.

Thanks.

rdeboer’s picture

Yep, the fix is in file revisioning_api.inc, lines 37, 38 should look like this:

function revisioning_set_node_revision_info(&$node) {
  if (!isset($node->num_revisions) && isset($node->nid)) {
  ....
chrisgross’s picture

Thanks!

I will make the change manually and if you end up getting the other issue working smoothly, I will obviously have no problem overwriting it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.