Is there any way to prevent users editing the same content?

Talk about new features for CMSMS and modules.
Post Reply
jelle

Is there any way to prevent users editing the same content?

Post by jelle »

while writing a previous post, It occurred to me that two users might start to edit the same content and overwrite eachothers changes. Or is there some checks against that?

If not, there are two routes to take:
1) some kind of file locking.
This is probably most easy for endusers to comprehend, and relatively simple to implement: if a user still has an editor open, the system keeps a lock on that page/content and stops other users from editing the same file. some javascript on the editor page pings to the lockfile once every minute to signal that the page is still open and the lock should be kept. If no pings are recieved anymore, the lock expires in 3-5 minutes, and other users are allowed to edit. If the page is submitted, the lock is removed.
2) concurrent editing.
This is rcs/cvs-like in behaviour and harder to understand for non-coders. It does not delay editors with making changes. Every edit-page gets some version info with it (in a hidden tag). On submitting the page, the system checks if the version that the change was based on is the same as the version that is in the db. If it is, there is no need to merge, the content is stored and the version raised. If the version does not match, the system tries to do a 3-way merge with the original content, the submitted content and the newer version. If it fails, the user is returned to an edit page, with the conflicting sections higlighted. If it succeeds, the user is warned that automatic editing succeeded, but that the result might not be what the user intended. The back-end tools are already available on a unix commandline, but it may be more portable to reimplement those(partially) in php if they can't be found/reused from elsewhere. 
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Is there any way to prevent users editing the same content?

Post by Russ »

Patricia, has anything happened with this it seems important for version 1.0??

Russ
Post Reply

Return to “Feature ideas”