Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-09 11:15:33

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Simultaneous editing in multi-user environment

I haven’t been able to find any information on this, but would be interested to hear from others what problems one needs to watch out for.

For instance, from all I can tell, two users can edit the same article simultaneously, but there’s no warning issued. There then are two copies of that article open and when one user hits “save” it’ll overwrite any changes made by the other and vice versa.

I realise this is a tricky situation, but I think a warning should be displayed to prevent this.

Is there by any chance a plugin that could help here?

Cheers Martin

Offline

#2 2008-04-09 12:59:56

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Simultaneous editing in multi-user environment

Would it be sufficient if a warning was displayed at the top (where other warnings are shown as well) when you try to save an article that has been modified in the mean time by another user? In that situation the article would not be saved unless the user presses the ‘save’ button a second time (overriding the warning message).

Offline

#3 2008-04-09 13:37:51

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Simultaneous editing in multi-user environment

ruud wrote:

Would it be sufficient if a warning was displayed at the top (where other warnings are shown as well) when you try to save an article that has been modified in the mean time by another user? In that situation the article would not be saved unless the user presses the ‘save’ button a second time (overriding the warning message).

I think your suggestion would be an excellent step in the right direction. Although those warnings at the top are fairly subtle, the need to click “Save” twice adds an extra layer of safety.

Ideally one would get a warning when attempting to even open an article that another user is currently working on, but since I’m no programmer, I don’t know how difficult that would be to implement or whether it’s at all possible.

Last edited by masa (2008-04-09 13:40:39)

Offline

#4 2008-04-09 14:40:14

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Simultaneous editing in multi-user environment

A warning when opening an article is very very difficult, because while you can register whenever a user opens an article, that user could close the browser without TXP ever noticing this. So in that case the article would remain “locked” even though nobody is editing it.
Also, in that setup, the warning would not only happen if someone actually edited an article, but also if someone else just opened the article (using the edit link) to view its contents.

Offline

#5 2008-04-09 14:54:33

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Simultaneous editing in multi-user environment

That makes perfect sense and I see the potential difficulties.

So yes, your original suggestion would be a great feature to have.

Offline

#6 2008-04-09 16:59:52

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Simultaneous editing in multi-user environment

Does it make sense to save to a different version of the article (with another ID) and only in draft, when another user are editing it? So, my choice would be:

  • When saving first time an article that is being edited also by another user, display an advice without saving it
  • If a user then choose to save anyway, save it as a different copy, instead of original, and shift the status to Draft (to prevent publishing the same article twice on the live site). This way both the editing would not be lost, and in a second moment an editor could compare the two articles and choose which one to display, or merge the modifications.
  • The author should be warned that the article can’t be published live until the other author has finished his/her editing.

Ok, it’s a bit strange, but this is my rationale:

Imagine a multiauthor site, like a magazine, where the authors are very lazy or busy and don’t catch the logic of a CMS, or don’t see the warning message, or don’t catch the meaning, or simply make mistakes. In that not unusual case, one of the version could be totally lost. So I’d want to first preserve data, even at the cost of temporarily publishing a wrong version, as long as you can recover the other.

What do you think? It’s pure paranoia?It’s doable?

Z

Offline

#7 2008-04-09 17:04:41

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Simultaneous editing in multi-user environment

Too complicated.

Offline

#8 2008-04-09 17:34:22

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Simultaneous editing in multi-user environment

To implement? Any other idea to preserve anyway both content?

Offline

#9 2008-04-09 20:47:37

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Simultaneous editing in multi-user environment

SVN changeset 2857 implements what I suggested above.

When trying to save an existing article that has been modified by
someone else while you were editing it, this patch does not save the article at first, but shows a
warning instead. If you choose to ignore the warning, you can save the article by pressing the Save
button a second time.

This means your own modifications are not lost. When the warning is displayed, the article you see is the one that you edited. You can open a second browser window to see which modifications the other person made.

Zanza, your proposal is more complicated to implement and if the user does not notice the warning, but does see that the article status is not ‘live’, there’s a good chance he’ll change the status to ‘live’ and save it again, resulting in 2 live articles (both versions).

Last edited by ruud (2008-04-09 20:55:35)

Offline

Board footer

Powered by FluxBB