Hey,
I'm not too sure if this is more a bug or a feature request but here goes. My clients have come across an issue with the Revisioning module where they are given the message "You are not authorized to access this page" when they try to publish a revision that has already been published. I know you must be thinking that it's not really possible to do so unless you explicitly alter the url to try to but this event occurs because we have workflow emails sent out to moderators of content on our site. If 2 moderators open emails at the same time, one publishes the content and then the other tries to publish it they see the message I mentioned above.
My proposed solution is to redirect the user back to the revision view page with a drupal_set_message saying "This revision has already been published" or something to that effect.
The only problem is that I'm not really too sure about where to alter this (or I would've attached a patch). Currently I can see the most logical place would be in either _revisioning_node_revision_access or _revisioning_operation_appropriate but since the "publish revisions" op gets run through these functions on the view page it is a bit more complex than I first thought.
Can you recommend a way of changing this?
Cheers,
Adam
Comments
Comment #1
John Pitcairn CreditAttribution: John Pitcairn commentedSub. I've seen this happen too, I have users that love to bookmark the publish-confirm url and return to publish later.
Comment #2
RdeBoer@Zombienaute
I see what you're saying. The use-case makes sense.
Unfortunately as you found yourself the desired behaviour doesn't map well to Drupal core's way of doing things. I will have a look at the Revisioning source and see what can be done.
Rik
Comment #3
RdeBoerHi Zombienaute, John Pitcairn,
This is not pretty, but may get the job done as a quick and dirty....
In file revisioning.module, function
_revisioning_operation_appropriate()
, replace the code betweencase 'publish revisions:'
andbreak;
by:Let us know how you go...
Rik
Comment #4
RdeBoerActually, the above treats already published revisions and archive revisions in the same way.
So you may want to keep the message very generic or taylor it to the specific case using the $node->is_current property.
Replace the
drupal_set_message(...)
call by something like this:Comment #5
acbramley CreditAttribution: acbramley commentedHey RdeBoer,
Cheers! Just need to change
to
Comment #6
RdeBoerCool. I may clean up the code and incorporate your suggestion in the next version.
Thanks!