\Drupal\content_lock\ContentLock\ContentLock::releaseAllUserLocks() does not trigger the release event

Created on 18 June 2025, about 1 month ago

Problem/Motivation

\Drupal\content_lock\ContentLock\ContentLock::releaseAllUserLocks() is inconsistent with \Drupal\content_lock\ContentLock\ContentLock::release() as it does not trigger the release lock event for each lock it deletes.

Steps to reproduce

Proposed resolution

Add a method to release a collection of locks consistently and use it in this method and in the content lock timeout cron and anywhere else we find.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @alexpott
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    I'm think that \Drupal\content_lock\Event\ContentLockReleaseEvent should support multiple locks then we only need to trigger a single event. To me this is much better than triggering an event per entity. Or we could remove the event. and replace it will a break lock event that is triggered when your lock is broken not released as that is the only situation where I think an event is potentially useful... ie. send a message to a user that your lock has been broken by a user. Hmmm... maybe you could say the same for releasing... so yeah lets not remove the event. Let's make it support multiple locks...

    Also I wonder about the use case of this event firing on entity delete. Like if the entity has been deleted what does anyone care about the lock being released - the entity no longer exists!

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
Production build 0.71.5 2024