Toolbar js errors when you remove the administration menu

Created on 16 September 2022, about 2 years ago
Updated 4 June 2024, 6 months ago

Problem/Motivation

Missing toggle button on other menus than Manage, cause an error JS : Uncaught TypeError: $orientationToggleButton[0] is undefined

Steps to reproduce

This can be reproduced by doing unset($items['administration']); for specific role or user and that using hook_toolbar_alter.

Proposed resolution

Two options :
1 - Add JS condition before calling $orientationToggleButton[0] on /core/modules/toolbar/js/views/ToolbarVisualView.js
2 - Bring back toggle button to all menus.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Toolbar 

Last updated about 12 hours ago

  • Maintained by
  • 🇫🇷France @nod_
Created by

🇲🇦Morocco redamakhchan

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.71.5 2024