When revisions exist it is possible for a user to revert to an old revision while someone else is editing the page. Locking should also lock out being able to revert revisions. A message should be displayed on the revision page and the revert revision link be unavailable.

Not sure if this should be a bug or feature request.

Comments

eugenmayer’s picture

Known "issue". Well needs some work here. There are also other CRUD operations to think about. If you like, provide a patch :)

ohnobinki’s picture

Version: 6.x-2.2 » 6.x-2.4
ohnobinki’s picture

Title: Revisions » When reverting a node to a prior revision, respect users' locks
Status: Active » Needs review
StatusFileSize
new3.93 KB

I have tested that the attached patch will try to grab a lock for the node when a user decides to revert to a prior revision and that it will release the lock upon completion of the reversion.

Please test and give feedback.

ohnobinki’s picture

Title: When reverting a node to a prior revision, respect users' locks » When reverting a node to a prior revision, users' locks are disrespected
ohnobinki’s picture

Issue tags: +node revisions
StatusFileSize
new4.3 KB

Updated patch which fixes the unUnload javascript so that navigating away from the ``revert revision'' page releases the lock properly.

ohnobinki’s picture

...or the patch decides to disappear and needs to be posted again ;-).

eugenmayer’s picture

Wonderful addition guys! Thank you so much binki for helping with the maintainership and actually doing all the work!

omaster’s picture

This is really good. Something that could make it better is to display on the revision page that the page is locked before they click revert or even disable the revert link so they can't choose it while the page is locked?

Anyway this is really good.

Cheers

agentrickard’s picture

Need to revisit in light of 7.x. ++ on the actual feature.

[Update] This should probably be an optional setting. I can see some use-cases where this behavior is unwanted (e.g. when a superuser overrides editing behaviors.)

Taxoman’s picture

I am in favor of a configurable option that can disable the revert link and also send a message to the user keeping the node locked, and display to the other party _who_ is locking the node, so they can get in touch. On some sites, this should be possible for certain roles to override, and it would be elegant if such an admin user is first warned and informed about the possible implications, and on such an info page is also offered a link to override without communicating with the person locking the node.

IMO it would be very practical if the information contained the amount of minutes since the node in question was locked. That could ease the decision on when to override. If that number is low, it may be extra reason to get in touch first, but if it is very high, the likelihood of someone having opened the node for editing without actually working on it may be higher.

ohnobinki’s picture

@Taxoman: Please open (a) separate bug(s) for consideration of giving users extra information about who holds locks or how long they have been open.

ohnobinki’s picture

Version: 6.x-2.4 » 6.x-2.6
Assigned: Unassigned » ohnobinki
Status: Needs review » Needs work

I think that removing the revert links themselves would be unreasonable. It's nearly impossible to override the node revisions overview page. Just look at how the diff module overrides node_revision_overview(). I think that just setting a message with drupal_set_message() which is used for most of content_lock's communication with the user will have to be adequate.

I'll work on improving the patch as I have time.

Taxoman’s picture

#11: Separate feature request posted:

"Provide information about the lock to ease decision making"
http://drupal.org/node/1217704

omaster’s picture

Has this gone anywhere. I notice it is still not committed to the project?

Well at least it appears to not work.

Taxoman’s picture

Version: 6.x-2.6 » 7.x-1.x-dev
ohnobinki’s picture

Status: Needs work » Needs review

This is committed to 6.x-2.x in 8124aa5 and e7c158f which will appear in content_lock-6.x-2.8. For 7.x-2.x, these commits are merged in 3b51a4e and will appear in 7.x-1.3.

As EugenMayer mentioned, it might make sense for something of this nature to be added to the node deletion page. Open a new bug for that if you need that ;-).

ohnobinki’s picture

Status: Needs review » Fixed

In 6.x-2.8, 7.x-1.3 (being released now).

omaster’s picture

Awesomeness. :D

Thanks ohnobinki.

Status: Fixed » Closed (fixed)
Issue tags: -node revisions

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

bailey86’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev
Issue summary: View changes

Did a fix for this issue make it into version 8.x?