This patch allows modules to veto the transition of a revision from unpublished to published and vice versa as stated in the hook_revisionapi documentation.
It does this by checking for a hook to return FALSE and if so, uses drupal_goto to stop the form submission and thus vetoing the operation.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 982002-pre-hook-fix-1.patch | 2.46 KB | acbramley |
| #15 | 982002-revisioning-reroll.patch | 2.21 KB | josh waihi |
| #13 | revisioning_scheduler.tar_.gz | 1.77 KB | Shiny |
| #3 | revision-module-2.patch | 2.5 KB | Shiny |
| revisioning-module.patch | 2.95 KB | acbramley |
Comments
Comment #1
rdeboerThanks for the patch! Will have a closer look soon.
Comment #2
Shiny commentedI tried this against 6.x-3.11 (tarball), but the patch doesn't apply
$ patch -p0 < ../revisioning-module.patch
patching file sites/all/modules/contrib/revisioning/revisioning.pages.inc
Hunk #1 FAILED at 110.
Hunk #2 FAILED at 183.
2 out of 2 hunks FAILED -- saving rejects to file sites/all/modules/contrib/revisioning/revisioning.pages.inc.rej
patching file sites/all/modules/contrib/revisioning/revisioning_api.inc
Hunk #1 FAILED at 165.
Hunk #2 FAILED at 277.
Hunk #3 FAILED at 473.
3 out of 3 hunks FAILED -- saving rejects to file sites/all/modules/contrib/revisioning/revisioning_api.inc.rej
Comment #3
Shiny commentedaha, silly me. it expects a directory structure including "contrib".
i've rerolled it for the current directory, and removed the fullstop that was changed in a call to t() so translations don't need to update.
Comment #4
halcyonCorsair commentedsubscribing
Comment #5
neilnz commentedAlso subscribing.
Not sure about the method this patch uses, would be nicer to stop the form submission in a cleaner way...
Comment #6
Shiny commentedRdeBoer: I've got some code here (sent to me by Zombienaute) for scheduling revision publishing to a later timestamp. Is this something you'd be interested in including in the revisioning module instead of a seperate contrib module. Do you like the approach of adding more hooks?
Comment #7
johnpitcairn commentedtagging
Comment #8
rdeboer@Shiny, #6
Haven't tried it myself recently but can't publication of a pending revision be achieved already using the Rules module and Revisioning's Rules interface?
Comment #9
acbramley commentedRevisioning Scheduler simply adds 2 fields to the confirmation screen when a revision is set to be published. These default to the current day and time, or can be edited to a later day and time for future publication.
Comment #10
rdeboer@Zombienaute, #9
Sounds like a nice light-weight option to have included in Revisioning as an alternative to the much more heavy-weight approach of Rules.
Does this "Revisioning Scheduler" come as a (sub)module or as a patch?
Comment #11
acbramley commentedIt comes as a submodule but could easily be incorporated as a patch.
Comment #12
rdeboerSubmodule is good! Then people who don't want the functionality won't have to "pay" for the code.
Comment #13
Shiny commentedthe whole of the scheduling submodule code is attached here.
This is 99% code by Zombienaute, and small tweaks by me.
Needs the patch to the revisioning module from this issue to add the new hooks.
GPLed. (Zombienaute please reply with "yes, happy to GPL this")
Comment #14
acbramley commentedYeah that's cool, I'm happy to GPL this. :)
Comment #15
josh waihi commentedAdding patch that I can roll with drush make.
Comment #16
rdeboerCool! Thanks Josh, Zombienaute and Shiny.
I need to set some time aside to put these and other patches in, but busy with D7 port as well...
Sorry it's taking so long.
Comment #17
acbramley commentedHey
I've rerolled the patch using git (following instructions from http://drupal.org/node/1054616)
I've also been using the Revisioning Scheduler module on a project recently and have made some changes to it. Along with this I have now created a sandbox project on my account to centralise the module. You can find that here
Cheers
Comment #18
johnpitcairn commentedInteresting. I didn't get back this way for a while, and in the meantime I rolled my own Revisioning submodule that provides a Rules Action and Event, so the newly-saved and moderated revision ID can be reliably provided to Rules as an argument, then Rules can be used to schedule the publishing of a specific revision based on some arbitrary date field.
#8: Otherwise, I couldn't work out how to get the new revision ID into Rules, which appears to do a node_load() on the node id, and thus gets the current revision id, not the latest revision id.
If handled this way, the scheduled publish appears in the Rules Scheduler list, and the scheduled task can be deleted from there if required. This is in use on a live site, and works well, but needs additional work to make the scheduled-publish status more obvious in the revision list and elsewhere.
I'll check out your sandbox module.
Comment #19
acbramley commentedHey just wondering where you are at with reviewing my patch and sandbox module.
Cheers
Comment #20
rdeboerHi Zobmienaute (#19),
I have been busy working on the D7 port of Revisioning, for which I now have completed an alpha5.
As I'm in that area now, I'll have a look at your sandbox project and maybe look at incorporating that for D7, if that's ok with you?
Do you see any gotcha's with converting your Revisioning Scheduler to D7?
Rik
Comment #21
rdeboerI've committed the patch and Revisioning Scheduler as a submodule of Revisioning to the 6.x-3.x branch.
Probably needs some more testing. Wasn't quite sure if the revert operation worked as expected.
Thanks Zombienaute for the great work!
Rik
Comment #22
rdeboerFixed the "schedule on revert" bug and included Scheduler as submodule to Revisioning 6.x-3.12 and 7.x-1.0-beta1.
Thanks again to all involved and sorry for taking so long incorporating your wonderful work.
Rik
Comment #23
rdeboerFixed the "schedule on revert" bug and included Scheduler as submodule to Revisioning 6.x-3.12 and 7.x-1.0-beta1.
Thanks again to all involved and sorry for taking so long incorporating your wonderful work.
Rik
Comment #24
acbramley commentedAwesome! Thanks so much.
Comment #25
acbramley commentedIf you want to make me a co-maintainer I would be happy to continue helping you out on this module.