Issues with toolbar subtrees hash and caching

Created on 5 January 2024, 11 months ago
Updated 5 February 2024, 9 months ago

Problem/Motivation

Drupal 10.2.0 introduces a new concept to cache things with cache contexts using the new VariationCache β†’ . This change breaks the way profile manager caches its toolbar subtrees with a fatal error:

The complete set of cache contexts for a variation cache item must contain all of the initial cache contexts

Further, the hash calculated for toolbar subtrees should not include array values (link urls) in its calculation as this can lead to false access denied under certain circumstances. See πŸ› Faulty Toolbar Subtree Hash Needs work for more information, that issues deals with the same problem but inside the toolbar module. This issue happens with the toolbar module for example if wse is appending the workspace id to all links via its path processor.

Steps to reproduce

On a site that used profile_manager and its toolbar on Drupal 10.1 or below, update to Drupal 10.2

Proposed resolution

Create the cacheability based on the render array. Also use only the array keys of a toolbar subtree for hash calculations.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024