Make compatible with Gin Toolbar

Created on 11 January 2022, about 3 years ago
Updated 7 February 2023, about 2 years ago

Problem/Motivation

Because of the overlap in menu building logic, this module is not compatible with Gin Toolbar β†’ . I'm pretty sure modules like Gin Toolbar and Admin Toolbar won't add compatibility with this module, so it's better to do it the other way around.

Steps to reproduce

  1. Install both Gin Toolbar and Admin Menu Swap
  2. Configure Admin Menu Swap to use a different menu for a certain role. The menu will not be swapped.

Proposed resolution

  • Make Amswap::preRender the only pre_render callback to be applied, instead of appending to the array. Both Gin Toolbar and Admin Toolbar do the same thing, to make sure changes are not overridden.
  • Add a hook_module_implements_alter implementation to make sure this module runs last.
  • Add Gin Toolbar specific logic to Amswap::preRender. Admin Toolbar specific logic is already present.
  • Render the usual admin menu if no role menu pairs are defined instead of returning early.
πŸ› Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

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