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.

Comments

rdeboer’s picture

Thanks for the patch! Will have a closer look soon.

Shiny’s picture

I 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

Shiny’s picture

StatusFileSize
new2.5 KB

aha, 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.

halcyonCorsair’s picture

subscribing

neilnz’s picture

Also subscribing.

Not sure about the method this patch uses, would be nicer to stop the form submission in a cleaner way...

Shiny’s picture

RdeBoer: 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?

johnpitcairn’s picture

tagging

rdeboer’s picture

@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?

acbramley’s picture

Revisioning 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.

rdeboer’s picture

@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?

acbramley’s picture

It comes as a submodule but could easily be incorporated as a patch.

rdeboer’s picture

Submodule is good! Then people who don't want the functionality won't have to "pay" for the code.

Shiny’s picture

StatusFileSize
new1.77 KB

the 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")

acbramley’s picture

Yeah that's cool, I'm happy to GPL this. :)

josh waihi’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.21 KB

Adding patch that I can roll with drush make.

rdeboer’s picture

Cool! 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.

acbramley’s picture

StatusFileSize
new2.46 KB

Hey

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

johnpitcairn’s picture

Interesting. 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.

acbramley’s picture

Hey just wondering where you are at with reviewing my patch and sandbox module.

Cheers

rdeboer’s picture

Hi 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

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Reviewed & tested by the community » Fixed

I'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

rdeboer’s picture

Fixed 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

rdeboer’s picture

Fixed 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

acbramley’s picture

Awesome! Thanks so much.

acbramley’s picture

If you want to make me a co-maintainer I would be happy to continue helping you out on this module.

Status: Fixed » Closed (fixed)

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