Hi all,
How is Drupal handling a concurrent update of the same node? When I tested it today, it did this ...

- user 1 logs in to edit node 20
- a minute later, user2 gets in and edits node 20
- for the next 10 minutes, both uses are busy updating content on node 20.
- At minute 11, user 1 saves page. He is happy.
- At minutes 12, user 2 save page and gets the above MSG. He's NOT happy.
- user 1 logs off, but user 2 still can not save.
- User 1 gets a raise and user 2 gets fired.

1- is this the default and designed behavior ?
2- Optimally. Drupal should've prevented user 2 from editing the page at all.
3- is there a feature or modules that can prevent a user from editing a node that is already being edited? Or at least, informs user that node is being edited?

I just can not believe this to be a sensible behavior in a CMS system where concurrent updates are the default behavior.

Any insights will be very much appreciated?

Comments

pobster’s picture

There is a 'checkout' module to prevent this from happening. It's here: http://drupal.org/node/31839

It looks though it's been updated to 5.x in the issue queue: http://drupal.org/node/125013

Pobster

cnewtonne’s picture

pobster,
I do appreciate your attention on this issue. I have no idea whey or how other Drupal users are not making a big issue out of this. It is so critical for me, that I will seriously think to migrate my site to some other CMS solution if I can not find a fix. Any how, I will try to push this as much as I can and I'll see how far I get.

I installed the module from the 2nd link you included. It did say (as well as the install file) that it is compatible with Drupl 4.6 and higher. It did install fine but I had issues preventing its use. I described them here http://drupal.org/node/147016

I sincerely hope I will be able to hear back from the author to get it to work. I do encourage other readers to participate and share their experience with this severe deficiency in Drupal core.

Thank you all.

Anonymous’s picture

I totally agree - this seems a serious issue, especially if you want to use Drupal for some sort of collaborative editing, especially in a wiki context. Should this become a general Drupal bug report or feature request?

martinwatson’s picture

Martin Watson (newbie)
Locking a node as soon as someone starts to edit it, is referred to as pessimistic locking.

Allowing two (or more) users to retrieve and start editing a node, and returning a write-conflict message such as 'this content has been modified by another user...' is referred to as optimistic locking.

Consider the following pessimistic locking situation:

User 1 logs in to edit node 20 and 'locks' node 20.

A minute later, user2 logs in, tries to edit node 20 but gets a message, 'record being edited'

For the next 10 minutes, user 1 edits node 20, answers the phone, chats to colleagues etc and user 2 checks every minute to see if it's free.

At minute 11, user 1, still in the middle of editing the node, goes off to lunch. He is then called away to a meeting etc etc.

User 2 spends the rest of the day waiting to edit node 20. He is not happy.

User 2 eventually has to get someone with the correct privileges (an administrator), to unlock it.

Pessimistic and optimistic locking both have their advantages and disadvantages depending on likelihood of concurrent update, how long users take to edit nodes, user discipline in unlocking/logging off, and so on. In an organisation, a network failure may result in hundreds of nodes being 'locked' out, and may cause problems for other areas in the organisation who cannot access the data until the locks are released.

What Drupal needs (and now appears to have,) is an option to use either locking strategy.

theorichel’s picture

I get this message when I am working on my own, as the sole person who has logged in (my site isnt live yet). I open a node that I am working on, do that work and try to save and then get this message.

Also, not now I get the message (no actual message, I just see it under Who's Logged in my name there twice. Have had that in Drupal 4.7 and 5.2, on different computers and on different hosts.

zemogle’s picture

I get this issue too. I edit a page and it submits fine, I go back in and edit the page soon afterwards and i get an error saying that another user is editing the content. No one else is logged in and I am using Safari on Mac OS 10.5

DoctorMike’s picture

Had a client with a Mac having the same problem, in June she created some content, then another user corrected some spelling on the content one hour after she had created it.

Now in July she is trying to update the content and it gave her this error message.

Now she went back and tried it and it worked, submitted ok.

Could it be a bug using the Mac Safari browser???

patoshi’s picture

hi, im getting the same problem.

i logged in with admin and then the next day I login with admin again on a different computer and I get this error. has anyone been able to come up with a fix or to why this is happening? I'm on drupal 5.7

chrisrikli’s picture

I ran into this issue with a custom node type but figured it out and wanted to post the solution:

My custom node type employed the hook_load() to pull data from another relevant table, let's call it "my_table" into the node object. The table has the following fields:
id
nid
vid
parent_nid
section_id
weight
created
changed

I did a simple "SELECT * FROM my_table WHERE nid = %d" and returned the object. The problem was that the fields "created" and "changed" overwrote the values pulled from the node table.

After I'd fixed the query to return everything but the "created" and "changed" from my_table, it occurred to me that those fields were completely unnecessary and redundant since timestamps are tracked in the node and node_revision tables. I removed those fields and set my query back to "SELECT *".

Hope this helps someone.

techczech’s picture

See here for an explanation of the issue: http://drupal.org/node/394694

vako’s picture

It's unbelievable that this issue still hasn't been fixed, it's an important issue and has been around since the beginning of Drupal. Now in version 7 we still don't have a solution?!

We should have the following:
- A user who tries to edit a document which is already open by another user, should get a message indicating so, with option of getting notified if the node becomes available.
- The lock mechanism should also show which user has the lock, in case another user needs to do an emergency update and need it released.

I hope we can see an update to Drupal 6 to have this option and it surely should be available in Drupal 7.

YK85’s picture

It looks like http://drupal.org/project/content_lock also exists to fix this issue in D6.

vako’s picture

http://drupal.org/project/content_lock module should be added to Drupal core!

Dharmendra.s’s picture

When the edit page load again, the form has a hidden field  name edit-changed like below (based on drupal 8 )
<input data-drupal-selector="edit-changed" type="hidden" name="changed" value="1536156322">

The value would be updated node->changed value , match it with db "node_field_data" table ,

if the value is not same as $node->changed , then this error would appear, Change it to node->changed value every time when form load the error would be fixed