'Account administration pages' language negotiation causes 'access denied' in toolbar subtree caching.

Created on 10 April 2017, about 7 years ago
Updated 13 January 2024, 5 months ago

Problem/Motivation

When enabling the 'Account Administration Pages' language negotiator for interface language, the Toolbar module throws an 'Access Denied' when trying to load the cached subtrees.

Steps to reproduce

  1. Install a standard installation (drush si)
  2. Do NOT disable caching in for example settings.local.php
  3. Enable content translation and interface translation
  4. enable Spanish and English
  5. Set language negotiation as follows:
  6. Set preferred administration language of user 1 to english.
  7. Create an article and view the full node
  8. Navigate to the same page but in 'Spanish' using the language switcher or just adding 'es' to the url. Should be [localhost]/es/node/1

The toolbar breaks, because of a 403 on an ajax request to load the subtrees. The browser will show the following error:
POST http://localhost/devdays/toolbar/subtrees/nAMBTIOqWe13vT5ZIhj_JroJ1d-FcDGfVKyhzq6wpFA?_wrapper_format=drupal_ajax 403 (Forbidden)

The problem has to do with the fact that the hashes for the cached subtree and the requested subtree don't coincide and therefore return a 403. See
ToolbarController::checkSubTreeAccess()

We have to find out whether this problem lies with the language negotiator for Account administration pages (and possibly other ones too, haven't tested...) or with the Toolbar module.

Proposed resolution

-

Remaining tasks

-

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Toolbar 

Last updated 1 day ago

  • Maintained by
  • 🇫🇷France @nod_
Created by

🇪🇸Spain nuez Madrid, Spain

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

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