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 ofnode_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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | delete-scheduled-revision-publications-for-deleted-nodes-1790748-1.patch | 2.2 KB | pbuyle |
Comments
Comment #1
pbuyle commentedThe attached patch implement the proposed solution and implement hook_update_N() to deleted scheduled publication of already deleted nodes.
Comment #2
pbuyle commentedComment #3
rdeboerThanks so much mongolito.
Hope to find time to apply your patch soon.
Rik
Comment #4
rdeboerPatch committed to 7.x-1.x branch (7.x-1.x-dev snapshot).
Sorry for the delay.
Thanks Pierre!
Rik