Needs review
Project:
Revision scheduler
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2011 at 09:37 UTC
Updated:
7 Aug 2014 at 12:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
johanh commentedI have the same problem. Isn't this a bug?
Comment #2
cweagansI spent some time debugging this and I know what the problem is, but I don't know how to fix it.
Here's the problem:
revision_scheduler queues up a bunch of stuff to do on hook_cron, then hook_cron_queue_info takes care of actually executing it.
The cron queue worker for revision scheduler (defined in revision_scheduler_cron_queue_info) is revision_scheduler_operation_process(), which loads data about the operation from the database and executes it. In our case, the operation callback is workbench_moderation_moderate().
workbench_moderation_moderate() expects that there is data in $node->workbench_moderation['my_revision'] (line 1429 of workbench_moderation.module). That data really should be there because revision_scheduler_operation_process() loads the entity data with revision_scheduler_entity_revision_load(), which calls entity_load().
workbench_moderation implements hook_node_load() and calls workbench_moderation_node_data() on each node being loaded, and workbench_moderation_node_data() is what would actually add the data that workbench_moderation_moderate() is looking for.
Instead, though, $node->workbench_moderation['my_revision'] is empty in workbench_moderation_moderate(), which messes up the $new_revision object on line 1440 of workbench_moderation.module, which, in turn, messes up pretty much everything from line 1475 to 1505 in workbench_moderation.module.
Comment #3
cweagansSo the problem on our site was that the content types that we were trying to schedule weren't actually dealt with by workbench. We just needed a regular unpublish action. There's a patch for that here: #1828646: Provide a regular publish/unpublish revision operation (without workbench)
Comment #4
arpieb commentedWe're running into the same thing, which is due to the fact that workbench_moderation_moderate doesn't handle unpublishing a revision, which is part of the actual state transition to an unpublished state.
This patch introduces a revision to the moderation state change operation to properly leverage a new workbench_moderation unpublish function added via patch in #1781852: Function to expire and unpublish content if available; otherwise the code should act as always.
Comment #5
mstef commentedLooks like it's working fine for me -- combined with the referenced patch.
Comment #6
gmclelland commentedNote: There is also patches in #1828646: Provide a regular publish/unpublish revision operation (without workbench) that provide similar functionality.
Can anyone tell me if those patches in #1828646: Provide a regular publish/unpublish revision operation (without workbench) make these patches unnecessary?
Maybe you just need the patch here if your are using workbench moderation??
Comment #7
jgalletta commentedPatch from comment #4 is working for me too, combined with the referenced patch.