Problem/Motivation

revisioning_scheduler_cron() tries to publish revisions of deleted nodes. It blindly invokes _revisioning_publish_revision(node_load($revision->revision_nid, $revision->revision_vid)) with the rows found in {revisioning_scheduler}. It does not validate that the node revisions actually exist. But when a node is deleted, the matching rows in {revisioning_scheduler} are not deleted.

This may break implementation of hook_node_update(), for instance of they use field_get_items() to retrieve a field value. In such as case, an exception could be thrown. This will strop the execution of revisioning_scheduler_cron() and prevent publication of the (valid) revisions scheduled after the one of a deleted node.

Proposed resolution

  • In revisioning_scheduler_cron(), check the result of node_load($revision->revision_nid, $revision->revision_vid) before using it as argument of _revisioning_publish_revision()
  • Implements hook_node_delete() to delete scheduled publications of deleted nodes' revisions.

Comments

pbuyle’s picture

The attached patch implement the proposed solution and implement hook_update_N() to deleted scheduled publication of already deleted nodes.

pbuyle’s picture

Title: revisioning_scheduler_cron() tries tu publish revision of deleted nodes » revisioning_scheduler_cron() tries to publish revisions of deleted nodes
Status: Active » Needs review
rdeboer’s picture

Assigned: Unassigned » rdeboer

Thanks so much mongolito.
Hope to find time to apply your patch soon.
Rik

rdeboer’s picture

Status: Needs review » Fixed

Patch committed to 7.x-1.x branch (7.x-1.x-dev snapshot).
Sorry for the delay.
Thanks Pierre!
Rik

Status: Fixed » Closed (fixed)

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