Problem/Motivation
When I render a shortcut set on a block, adding/removing a shortcut to the set won't flush the set cache. In other words, the block won't display the newly added shortcut link until the cache is cleared manually.
Steps to reproduce
1. Create a shortcut set (or use the 'default' set)
2. Create a custom block and render the shortcut set.
3. Place the block on the page (e.g. admin/*)
4. Add links to the shortcut by clicking the star next to the title
Expected:
On page reload, the new link appears on the block.
Actual:
No new link on the block.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #3
manuel.adanI managed to reproduce the bug, and it is beyond the shortcut block. Shortcut links listed at the toolbar menu aren't also refreshed.
In my case, the steps to reproduce are, on a fresh standard D9.4 installation:
As far I can see, the only cache tag involved in the shortcut listing is related to the shortcut set and changes on the assigned set don't invalidate the set tags. A new cache tag should be created, linked to the user assigned shortcut set, in order to invalidate the current shortcut set rendering.
Comment #4
catchThe original bug report and the patch in #3 don't match each other. The initial report is that new links added to an existing set don't update the shortcust list/toolbar, the patch is about assigning a new shortcut set to a user.
The user assign issue I would expect to be handled by a cache context, not a cache tag - it's not the content of the shortcut set that's changing but which shortcut set a user is using. The original bug report seems like maybe a missing list cache tag somewhere.
Comment #9
quietone commentedThe Shortcut Module was approved for removal in #3476880: [Policy] Move Shortcut module to contrib.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3569117: [meta] Tasks to deprecate the Shortcut module and the removal work in #3569121: [meta] Tasks to remove the Shortcut module.
Shortcut will be moved to a contributed project before Drupal 12.0.0 is released.
Comment #10
smustgrave commented