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

Created on 15 August 2023, 11 months ago
Updated 21 August 2023, 10 months 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

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 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States justcaldwell

    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 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States justcaldwell

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

Production build 0.69.0 2024