7

I'm assuming that the record is locked so that only one user - presumably the first - can edit, whilst others are locked out until the record has been saved. But I don't know, and a client has just raised the issue, so I'd like to provide a definitive answer.

3 Answers 3

5

Tested on CiviCRM 4.7: two users can edit the same contact record, however, at the moment of saving the contact record, the second user to save the contact record will get a warning that the contact record has been modified by someone else. The user will then have an option to save anyway or reload the page.

Conflict editing the contact record

It also works with inline edit:

Inline edit conflict

3
  • So if the 2nd user clicks "Save anyway" and the 1st user is still editing, and then the 1st user saves their changes, presumably they'll get the same warning, and by clicking "Save anyway" they'll potentially override the changes made by the 2nd user. The 2nd user doesn't know this. The 1st user never saw what the 2nd user did, so both users are in the dark. Wouldn't it be clearer if the 2nd user had no opportunity to even get to the edit screen until the 1st user had saved?
    – Graham
    Commented May 24, 2017 at 15:16
  • The odds of having that type of edit conflict are (in my gut feeling) rather small. I have rarely had complaints about it from clients, but I understand that it can happen more frequently for some types of organisations/workflows. I think it would be a useful extension!
    – bgm
    Commented May 24, 2017 at 16:01
  • Agreed, the probability may be small, but it remains a possibility. And the greater the number of active users and/or the lower the number of contact records in the database, the more likely it is for the issue to arise.
    – Graham
    Commented May 25, 2017 at 10:21
2

Here is an older thread with some changes that went into 4.3 (not sure if there have been further changes since then):

Note: Initial discussions were held via email with followups on IRC on Monday (16-Jul-12) and Wednesday (18-Jul-12). An extra discussion document was included on Wed ( http://pastebin.com/BieCSzXa ). A blog post explored the issue further. Another IRC conversation (13-Aug-12) settled on optimistic locking.

Some key design decisions:

  1. Locks are optimistic
  2. Locks apply coarsely to all core contact tables -- civicrm_contact, civicrm_address, civicrm_phone, civicrm_email, civicrm_website, civicrm_im, and single-value custom-data
  3. The key used to check revisions will be a "modified" timestamp on civicrm_contact
  4. Locks are only checked for the "Edit Contact" and "View Contact - Inline Edit" screens. Other screens will not read the "modified" timestamp or display warnings/errors about it; however, other screens will update the "modified" timestamp.
1
  • Thanks for this. Can I assume then that in the case of, for example, editing an activity record, that no record locking takes place? And if so, can anyone cast any light on the potential implications?
    – Graham
    Commented Apr 29, 2016 at 10:44
0

Can anyone confirm what record locking, if any, is implemented in CiviCRM 4.6 or 4.7?

I swear I've seen a message which tells you someone else has the record open - are you sure you want to save changes, but I can't replicate it on our site.

thanks Jon-man

1
  • want to make this a separate question before folks start down voting it since it is not an answer
    – petednz - fuzion
    Commented Jun 14, 2016 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.