escapeAdminPath sessionStorage should be namespaced

Created on 25 March 2021, over 3 years ago
Updated 26 June 2024, 2 days ago

Problem/Motivation

All other Drupal sessionStorage and localStorage items are namespaced like "Drupal.[module].storageTokenName" but not "escapeAdminPath".

https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/modules/tool...

/**
 * @file
 * Replaces the home link in toolbar with a back to site link.
 */

(function ($, Drupal, drupalSettings) {
  const pathInfo = drupalSettings.path;
  const escapeAdminPath = sessionStorage.getItem('escapeAdminPath');
  const windowLocation = window.location;

Steps to reproduce

Proposed resolution

1.- Namespace it.

-   const escapeAdminPath = sessionStorage.getItem('escapeAdminPath');
+   const escapeAdminPath = sessionStorage.getItem('Drupal.toolbar.escapeAdminPath');

2.- Consider cleaning up the old un-namespaced item pollution.

Is there a policy for clearing old variable names from js app storage?

Remaining tasks

  1. write patch.
  2. review.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Release notes snippet

📌 Task
Status

Needs review

Version

11.0 🔥

Component
Javascript 

Last updated about 4 hours ago

Created by

🇪🇨Ecuador jwilson3

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