Problem/Motivation

The following code in \Drupal\content_lock\ContentLock\ContentLock::locking

        // There is a stale lock. Release it.
        if (is_object($lock) && $lock->uid != $uid) {
          $this->release($entity, $form_op, $uid);
        }
        // Save locking into database.
        $this->lockingSave($entity, $form_op, $uid);

does not work because passing $uid is not right - it should be $lock->uid

Steps to reproduce

Take over a stale lock and see that the lock is not released correctly. The later merge in \Drupal\content_lock\ContentLock\ContentLock::lockingSave() overwrites the lock.

Proposed resolution

Pass the correct UID in and test it.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Reviewed & tested by the community

  • alexpott committed 12dfc378 on 3.x
    fix: #3598231 Lock is not released when a stale lock is said to release...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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