After update to Drupal 8.2.1 Environment Indicator Switcher didn't work anymore.

The Link in the toolbar is only a link, seems there is know event listener to switch the links in the tray.

In environment_indicator_toolbar(), if i change:

  $items['environment_indicator'] += [
    'tab' => [
      '#type' => 'link',
      '#access' => $permission,
      '#title' => $title,
      '#url' => \Drupal\Core\Url::fromRoute('environment_indicator.settings'),
      '#options' => [
        'attributes' => [
          'title' => t('Environments'),
          'class' => [
            'toolbar-icon',
            'toolbar-item',
            'toolbar-icon-environment',
          ],
        ],
      ],
    ], ...

to

  $items['environment_indicator'] += [
    'tab' => [
      '#type' => 'link',
      '#access' => $permission,
      '#title' => $title,
      '#url' => \Drupal\Core\Url::fromRoute('environment_indicator.settings'),
      '#attributes' => [
        'title' => t('Environments'),
        'class' => [
          'toolbar-icon',
          'toolbar-item',
          'toolbar-icon-environment',
        ],
      ],
    ], ...

it works.
But the colors in the tray are still gone.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

uwe_k created an issue. See original summary.

uwe_k’s picture

Title: Environment Indicator Switcher breaks down in core 8.2.1 » Environment Indicator Switcher breaks down with drupal core 8.2.1
Issue summary: View changes
nicrodgers’s picture

Version: 8.x-3.0-beta1 » 8.x-3.x-dev
Category: Task » Bug report
nicrodgers’s picture

Title: Environment Indicator Switcher breaks down with drupal core 8.2.1 » Environment Indicator Switcher tab stops working with Drupal core >= 8.2.0

I've replicated this with the latest 8.x-3.x dev version of the module, and with:
* Drupal Core 8.2.3
* Drupal Core 8.2.1
* Drupal Core 8.2.0

Tested working ok in:
* Drupal Core 8.1.0
* Drupal Core 8.1.7

Updating the issue title to reflect.

nicrodgers’s picture

nicrodgers’s picture

Status: Active » Needs review

I've tested the patch in 8.2.x and 8.1.x and with the patch applied it seems to work ok now.

e0ipso’s picture

Thanks for the report and the patch! I'll be merging soon.

  • e0ipso committed 44dc97a on 8.x-3.x authored by nicrodgers
    Issue #2820776 by nicrodgers, uwe_k: Environment Indicator Switcher tab...
e0ipso’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.