Problem/Motivation

Environment Indicator is throwing errors such as:
Notice: Undefined index: switcher in template_preprocess_environment_indicator() (line 139 of /home/d1sya/www/sites/default/modules/environment_indicator/environment_indicator.module).

I am able to reproduce on a simplytest.me site. The only happens when the environment indicator does not use an integration, and prints itself to the page, and with no "switcher" setup.

Easiest way to reproduce:

  1. Create a new site on simplytest.me
  2. Enable environment indicator
  3. Add permission to view Environment Indicator to anonymous and authenticated
  4. Open a page in an incognito window, and check the log
CommentFileSizeAuthor
#2 php_warning_undefined-2834459-2.patch643 bytesdpagini
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dpagini created an issue. See original summary.

dpagini’s picture

I have no idea if I'm doing this right, but here is an attempt at a patch for this... all feedback welcome!

trwill’s picture

Status: Active » Needs review
trwill’s picture

Status: Needs review » Reviewed & tested by the community

Saw the same issue - pulled down patch via composer and applied to project. Works great, thanks!

trwill’s picture

Status: Reviewed & tested by the community » Needs review

  • e0ipso committed bb661d9 on 8.x-3.x authored by dpagini
    fix(Performance): Remove undefined warninf (#2834459 by dpagini)
    
e0ipso’s picture

Status: Needs review » Fixed

Thanks all! This was fixed!

Status: Fixed » Closed (fixed)

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