content_lock_entity_operation doesn't work if the entity list is cached

Created on 26 October 2017, over 6 years ago
Updated 31 May 2024, 28 days ago

Problem/Motivation

If we have a list view e.g. the content view, which is being cached then the hook for adding the operations will not work properly, because a Break Lock operation is added only if the entity is currently locked, which is a dynamic behaviour, but the view might be already cached with or without the break lock operation, which will not change until the cache is invalidated, because if the view is retrieved from the cache then the hook will not be invoked.

Proposed resolution

Three options:
Completely remove the operation and offer a controller instead of a view for all content entity types where the entities of all entity types having a lock are listed.
Always add the operation and if on clicking on it there is no lock then show a message that there is no lock.
On adding or removing a lock invalidate the entity_type_list cache tag.

I think that the first approach would be more user friendly than the second and third one actually means there is no need in caching the view at all.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany hchonov πŸ‡ͺπŸ‡ΊπŸ‡©πŸ‡ͺπŸ‡§πŸ‡¬

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024