[gin_toolbar] Add _gin_toolbar_gin_is_active() check to all hook implementations

Created on 15 August 2023, over 1 year ago
Updated 21 August 2023, over 1 year ago

Problem/Motivation

All of Gin Toolbar's preprocessor implementations return early if Gin is not active, e.g.:

function gin_toolbar_preprocess_html(&$variables) {
  // Are we relevant?
  if (!_gin_toolbar_gin_is_active()) {
    return;
  }

This is great—in theory—as it should allow the admin theme to be changed without uninstalling Gin Toolbar. Unfortunately, the other hook implementations don't contain the check, and go on to make changes that introduce issues when Gin is not an active theme.

We're evaluating both Claro and Gin. If the admin theme is switched to Claro while Gin Toolbar is still enabled, we see the issues illustrated below.

Proposed resolution

Add the _gin_toolbar_gin_is_active() check to all of Gin Toolbar's hook implementations.

✨ Feature request
Status

Closed: won't fix

Version

3.0

Component

Code

Created by

🇺🇸United States justcaldwell Austin, Texas

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

Comments & Activities

  • Issue created by @justcaldwell
  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States justcaldwell Austin, Texas

    After adding the check to all hook implementations, we can now switch between Gin and Claro (or other) admin theme without the need to enable/disable Gin Toolbar.

    I also noticed that the Environment Indicator toolbar color was missing prior to the changes, but is working again ('purple' toolbar below).

    See the MR in the child issue.

    Claro with Gin Toolbar enabled (fixed)

  • Status changed to Closed: won't fix over 1 year ago
  • 🇺🇸United States justcaldwell Austin, Texas

    Setting to closed won't fix -- see child issue for details.

Production build 0.71.5 2024