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

CommentFileSizeAuthor
#3 3229983-3.patch2.05 KBmanuel.adan

Comments

vijaycs85 created an issue. See original summary.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

manuel.adan’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new2.05 KB

I 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:

  1. login as admin, the default "Add content" and "All content" shortcuts should be listed in the shortcut toolbar menu
  2. create a new shortcut set at Admin -> Configuration -> User Interface -> Add shortcut set (admin/config/user-interface/shortcut/add-set), name it as "Test". Shortcuts from the default set are cloned into the new set
  3. click on "Add shortcut" to add a new shortcut, name "New page" and path "/node/add/page", save it
  4. change the user assigned shortcut set to the just created "Test" at user/1/shortcuts
  5. the "New page" shortcut is not listed in the shortcut toolbar menu as expected

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.

catch’s picture

Status: Needs review » Needs work
Issue tags: +Bug Smash Initiative

The 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.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Status: Needs work » Postponed

The 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.

smustgrave’s picture

Project: Drupal core » Shortcut (from core)
Version: main » 2.x-dev
Component: shortcut.module » Code
Status: Postponed » Needs work