Duplicate of š¬ Granular permissions are not working as expected. Active
trackleft2 ā created an issue.
Also, it appears that all of the gitlab-ci tests are currently passing due to this issue: š¬ Validate stage may use outdated artifact, leading to flaky test results Active
I've updated the PHPUnit tests so that they pass in all of the gitlab-ci jobs.
While updating the PHPUnit Test I was testing the module using the combination of PHP 8.3 and Drupal Core 11.0.13 as well.
trackleft2 ā created an issue.
At the moment, when I enable the gin_toolbar module without the gin them being enabled the javascript breaks because the toolbar id changes from toolbar-bar to gin-toolbar-bar.
Additionally, when enabling the submodule the "default" environment indicator appears.
What should we do about the toolbar integration setting? I think if the environment_indicator_toolbar submodule is enabled, the default indicator should be disabled to keep existing functionality.
Fixed in 4.x to be released in 4.0.22 š± [META] Release Plan for Environment Indicator Patch Release 4.0.21 Needs review
Fixed in #3092900: Issue when viewing front page ā where I've added credit.
trackleft2 ā changed the visibility of the branch 3065135-add-support-for-tugboat to hidden.
FYI I've added instructions to this module's .tugboat configuration file to install gin and gin_toolbar module, set gin as the default admin theme, and three environment switchers in order to help us test.
To view a demo site with a copy of the module installed with this merge request applied, click the view live preview link under this issue's summary.
To log in use these credentials
username: admin
password: admin
I've done the same on š Update module to use CSS variables instead of adding inline CSS. Active If you'd like to review that alternate Merge request.
FYI I've added instructions to this module's .tugboat configuration file to install gin and gin_toolbar module, set gin as the default admin theme, and three environment switchers in order to help us test.
To view a demo site with a copy of the module installed with this merge request applied, click the view live preview link under this issue's summary.
trackleft2 ā changed the visibility of the branch 3487973-add-gin-theme to hidden.
Hi there, if this issue is resolved by either š Gin Compatibility: Account for "open" vertical toolbar Closed: outdated or š Update module to use CSS variables instead of adding inline CSS. Active we could use your review on those issues instead. If so, please close this one as either a duplicate or outdated.
Hi, were you experiencing any console errors on the environment that the favicon is broken on? I noticed that the dependency order of the libraries is weird in this file https://git.drupalcode.org/project/environment_indicator/-/blob/4.x/envi...
If it is a load order thing, the solution in ⨠Separate Tinycon into its own library and use favicon option to determine inclusion. Active may resolve it.
I've converted the patch to a merge request and updated it to integrate any upstream changes that have been merged.
Unfortunately this does not seem to work for me using Lando for local development.
If I enter: /core/themes/olivero/favicon.ico
The Json settings output looks like this
"environmentIndicator":{"name":"Lando","fgColor":"#EFEFEF","bgColor":"#990055","addFavicon":true,"faviconPath":"\/app\/web\/core\/themes\/olivero\/favicon.ico","toolbars":{"toolbar":"toolbar"}}
Seems to be setting the absolute path on the server.
Here is my config
```
name: environment_indicator
recipe: drupal10
config:
php: '8.3'
via: apache:2.4
webroot: web
database: mariadb:10.6
xdebug: false
services:
database:
type: compose
services:
image: mariadb:10.6
command: docker-entrypoint.sh mariadbd
restart: always
ports:
- '3306'
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'true'
MARIADB_DATABASE: drupal10
MYSQL_DATABASE: drupal10
MARIADB_USER: drupal10
MARIADB_PASSWORD: drupal10
appserver:
overrides:
environment:
SIMPLETEST_DB: 'mysql://drupal10:drupal10@database/drupal10'
SIMPLETEST_BASE_URL: 'http://appserver'
volumes:
# Don't share our host working directory as /app. We want /app empty for composer.
- /app
# Instead share our host working directory as a standalone package.
- .:/usr/local/environment_indicator
build:
# Create a new Drupal project and use the module as a non-packagist repository.
- composer create-project --dev drupal/recommended-project:11.1.x /app
- composer config extra.enable-patching true
- composer config extra.composer-exit-on-patch-failure true
- composer config allow-plugins.cweagans/composer-patches true
- composer require cweagans/composer-patches
- composer config minimum-stability dev
- composer config allow-plugins.phpstan/extension-installer true
- composer require --dev drupal/core-dev:^11.1 drush/drush phpspec/prophecy-phpunit:* phpstan/extension-installer mglaman/phpstan-drupal phpstan/phpstan-deprecation-rules drupal/config_inspector drupal/devel drupal/gin
- composer config repositories.localdev path /usr/local/environment_indicator && composer require drupal/environment_indicator:\*@dev
node:
type: node:20
build:
- yarn install
chromedriver:
type: compose
services:
image: seleniarm/standalone-chromium:4.1.4-20220429
command: /opt/bin/entry_point.sh
tooling:
# Provide a command to install Drupal.
install:
service: appserver
cmd:
- /app/vendor/bin/drush --root=/app/web site:install --account-mail=noreply@example.com --account-name=admin --account-pass=admin --db-url=mysql://drupal10:drupal10@database:3306/drupal10 -y --verbose
- /app/vendor/bin/drush --root=/app/web en -y environment_indicator environment_indicator_ui devel config_inspector
- /app/vendor/bin/drush --root=/app/web theme:enable -y gin
- /app/vendor/bin/drush --root=/app/web config:set -y system.theme admin gin
- /app/vendor/bin/drush --root=/app/web en -y gin_toolbar
- /app/vendor/bin/drush --root=/app/web config:set -y environment_indicator.indicator name 'Lando'
- /app/vendor/bin/drush --root=/app/web config:set -y environment_indicator.indicator bg_color '#990055'
- /app/vendor/bin/drush --root=/app/web config:set -y environment_indicator.indicator fg_color '#EFEFEF'
- /app/vendor/bin/drush --root=/app/web uli -l https://environmentindicator.lndo.site/
# Provide Drush tooling to automatically know the Drupal root.
drush:
service: appserver
cmd: /app/vendor/bin/drush --root=/app/web
phpcs:
service: appserver
cmd: /app/vendor/bin/phpcs -s --colors --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/environment_indicator
# Provide PHPCBF tooling to fix coding standards.
phpcbf:
service: appserver
cmd: /app/vendor/bin/phpcbf -s --colors --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/environment_indicator
# Provide phpstan tooling to check for code quality and deprecated code.
phpstan:
service: appserver
cmd: /app/vendor/bin/phpstan analyse --configuration web/modules/contrib/environment_indicator/phpstan.neon web/modules/contrib/environment_indicator
# Provide phpunit tooling to run unit tests.
phpunit:
service: appserver
cmd: /app/vendor/bin/phpunit --configuration /app/web/core/phpunit.xml.dist --bootstrap /app/web/core/tests/bootstrap.php /app/web/modules/contrib/environment_indicator
yarn:
service: node
cmd: yarn
eslint:
service: node
cmd: yarn run eslint --color
```
trackleft2 ā made their first commit to this issueās fork.
I've set a release target for š± Draft: Release Plan for Environment Indicator Minor Release 5.0.0-beta1 Active
Thank you for your inquiry, I've updated the issue summary. I welcome a merge request
trackleft2 ā changed the visibility of the branch 3500006-tugboat to hidden.
Packages: 114
When I ran composer -vv update
I saw
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in /vendor/php-tuf/php-tuf/src/CanonicalJsonTrait.php on line 46
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.%
@jwilson3, I've refactored your merge request slightly in order to roll in some fixes to the slideToggle functionality, and fix some syntax issues.
I've opened an additional merge request on this issue in order to trigger a new tugboat build. I feel like this is in good place at this point.
@jwilson, I don't think I understand what you are saying. Your code is what is triggering the eslint and stylelint errors at this point.
trackleft2 ā changed the visibility of the branch 4.x to hidden.
trackleft2 ā changed the visibility of the branch 4.x to hidden.
trackleft2 ā changed the visibility of the branch 4.x to hidden.
This also fixes š Basic environment indicator dropdown links are inaccessible. Active
trackleft2 ā created an issue.
trackleft2 ā changed the visibility of the branch 4.x to hidden.
I've reviewed this several times and I think it is ready for merging.
Interestingly enough, Environment Indicator module doesn't actually keep track of the environment it is on, nor does it have rules for getting that information.
However, if you are working on a site with the environment indicators set up you should be able to use the environment information in a round-about way with something like twig_tweak ā
{{ drupal_config(config_name, key) }}
{% set indicator = drupal_config('environment_indicator', 'indicator') %}
{% if indicator.get('name') == 'Local Dev' %}
<p>Show local something html locally</p>
{% else %}
<p>Everything for the live site</p>
{% endif %}
This is assuming you have something like this in your site's settings.php
/**
* Environment Indicator module settings.
* see: https://pantheon.io/docs/environment-indicator
*/
// Pantheon Env Specific Config
if (isset($_ENV['PANTHEON_ENVIRONMENT'])) {
switch ($_ENV['PANTHEON_ENVIRONMENT']) {
case 'lando':
// Localdev or Lando environments.
$config['environment_indicator.indicator']['name'] = 'Local Dev';
$config['environment_indicator.indicator']['bg_color'] = '#990055';
break;
case 'dev':
$config['environment_indicator.indicator']['name'] = 'Dev';
$config['environment_indicator.indicator']['bg_color'] = '#4a634e';
break;
case 'test':
$config['environment_indicator.indicator']['name'] = 'Test';
$config['environment_indicator.indicator']['bg_color'] = '#a95c42';
break;
case 'live':
$config['environment_indicator.indicator']['name'] = 'LIVE';
break;
default:
// Multidev catchall.
$config['environment_indicator.indicator']['name'] = 'Multidev: ' . $_ENV['PANTHEON_ENVIRONMENT'];
$config['environment_indicator.indicator']['bg_color'] = '#1e5288';
break;
}
}
}
else {
$config['environment_indicator.indicator']['name'] = 'Local';
$config['environment_indicator.indicator']['bg_color'] = '#707070';
}
I've updated this to remove some SCSS that was added in here by mistake.
trackleft2 ā created an issue.
trackleft2 ā changed the visibility of the branch 3483055-fix-stylelint-issues-tugboat to hidden.
trackleft2 ā changed the visibility of the branch 4.x to hidden.
Update drush command so it uses the correct configuration keys.
Add an image that shows the version identifier.
I've added a Version Identifiers section to the docs. Please review https://www.drupal.org/docs/extending-drupal/contributed-modules/contrib... ā
I am unable to reproduce this error, here is my Lando setup. Feel free to reopen if you disagree.
name: environment_indicator
recipe: drupal10
config:
php: '8.1'
via: apache:2.4
webroot: web
database: mariadb:10.6
xdebug: false
services:
database:
type: compose
services:
image: mariadb:10.6
command: docker-entrypoint.sh mariadbd
restart: always
ports:
- '3306'
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'true'
MARIADB_DATABASE: drupal10
MYSQL_DATABASE: drupal10
MARIADB_USER: drupal10
MARIADB_PASSWORD: drupal10
appserver:
overrides:
environment:
SIMPLETEST_DB: 'mysql://drupal10:drupal10@database/drupal10'
SIMPLETEST_BASE_URL: 'http://appserver'
volumes:
# Don't share our host working directory as /app. We want /app empty for composer.
- /app
# Instead share our host working directory as a standalone package.
- .:/usr/local/environment_indicator
build:
# Create a new Drupal project and use the module as a non-packagist repository.
- composer create-project --dev drupal/recommended-project:10.0.x /app
- composer config extra.enable-patching true
- composer config extra.composer-exit-on-patch-failure true
- composer config allow-plugins.cweagans/composer-patches true
- composer require cweagans/composer-patches
- composer config minimum-stability dev
- composer config allow-plugins.phpstan/extension-installer true
- composer require --dev drupal/core-dev:^10.0 drush/drush phpspec/prophecy-phpunit:* phpstan/extension-installer mglaman/phpstan-drupal phpstan/phpstan-deprecation-rules drupal/config_inspector drupal/devel
- composer config repositories.localdev path /usr/local/environment_indicator && composer require drupal/environment_indicator:\*@dev
node:
type: node:20
build:
- yarn install
chromedriver:
type: compose
services:
image: seleniarm/standalone-chromium:4.1.4-20220429
command: /opt/bin/entry_point.sh
tooling:
# Provide a command to install Drupal.
install:
service: appserver
cmd:
- /app/vendor/bin/drush --root=/app/web site:install --account-mail=noreply@example.com --account-name=admin --account-pass=admin --db-url=mysql://drupal10:drupal10@database:3306/drupal10 -y --verbose
- /app/vendor/bin/drush --root=/app/web en -y environment_indicator environment_indicator_ui devel config_inspector
- /app/vendor/bin/drush --root=/app/web uli -l https://environmentindicator.lndo.site/
# Provide Drush tooling to automatically know the Drupal root.
drush:
service: appserver
cmd: /app/vendor/bin/drush --root=/app/web
phpcs:
service: appserver
cmd: /app/vendor/bin/phpcs -s --colors --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/environment_indicator
# Provide PHPCBF tooling to fix coding standards.
phpcbf:
service: appserver
cmd: /app/vendor/bin/phpcbf -s --colors --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/contrib/environment_indicator
# Provide phpstan tooling to check for code quality and deprecated code.
phpstan:
service: appserver
cmd: /app/vendor/bin/phpstan analyse --configuration web/modules/contrib/environment_indicator/phpstan.neon web/modules/contrib/environment_indicator
# Provide phpunit tooling to run unit tests.
phpunit:
service: appserver
cmd: /app/vendor/bin/phpunit --configuration /app/web/core/phpunit.xml.dist --bootstrap /app/web/core/tests/bootstrap.php /app/web/modules/contrib/environment_indicator
yarn:
service: node
cmd: yarn
eslint:
service: node
cmd: yarn run eslint --color
I've updated this by converting the patch to a merge request.
font-size: 12px
seems rather small, I think I would recommend 1em instead, or another relative size for accessibility reasons, what do you think.
trackleft2 ā changed the visibility of the branch 3077678-uniform-status-bar to hidden.
trackleft2 ā made their first commit to this issueās fork.
Closing as a duplicate of ⨠Create basic PHPUnit tests. Active
This seems to work as expected.
Changing the order changes the order in the menu.
Thank you for your work on this.
I've merged in upstream repo changes (nothing touched this file obviously) and added in a comma to comply with coding standards.
Do you have any ideas on how to test this, or a PHPUnit test for this?
You can see some tests for this module here if interested.
trackleft2 ā made their first commit to this issueās fork.
Granting credit
Granting credit
Granting credit
Granting credit
Granting credit
Once this is reviewed and merged we'll finally have all useful (passing) CI tests..
Looks like this could be a duplicate of š Update module to use CSS variables instead of adding inline CSS. Active Sorry! Would you all be willing to review the merge request on that issue, and possibly add in anything from this issue that is required to combine the two?
trackleft2 ā changed the visibility of the branch 4.x to hidden.
I agree that maintaining compatibility with PHP 7.4 makes contributions trickier, and thereās value in targeting modern environments. That said, this patch is specifically scoped to fix a regression introduced in a patch release (4.0.18ā4.0.21) that broke sites still running PHP 7.4 ā without any documented change in requirements.
To avoid repeating that mistake, Iād suggest the following sequence:
- Merge this fix to restore compatibility in 4.x and ensure sites on PHP 7.4 can safely upgrade within the same major version.
- Create a final 4.0.x release that:
- Maintains support for Drupal 9.3 through 11.
- Avoids changes that break backward compatibility for supported environments.
- After that, address the syntax issue in š± Drop support for versions of Drupal older than 10.3 Active , which also drops support for Drupal core versions earlier than 10.3.
- Then create a 4.1.0-beta1 minor release
Weād appreciate review on any of the āNeeds reviewā issues blocking the final 4.0.x release:
š±
[META] Release Plan for Environment Indicator Patch Release 4.0.21
Needs review
or
š±
Draft: Release Plan for Environment Indicator 4.1.0-beta1
Active
My merge requests adds back support for PHP 7.4
It looks like the issue was caused by the trailing comma on this line:
https://git.drupalcode.org/project/environment_indicator/-/merge_request...
This syntax is valid in newer PHP versions, but breaks on PHP 7.4, which the module currently supports.
To help catch similar issues, Iāve added a PHPUnit test to lint PHP files across supported versions:
https://git.drupalcode.org/project/environment_indicator/-/merge_request...
While this wonāt catch the trailing comma specifically (as PHP 7.4 is no longer available in the GitLab runner environment), it sets us up for stricter compatibility checks going forward. Iād recommend holding off on using syntax that requires PHP 8.0+ until the module drops support for older versions in a future minor release.
I am also adding this issue to the š± [META] Release Plan for Environment Indicator Patch Release 4.0.21 Needs review
trackleft2 ā made their first commit to this issueās fork.
Thank you all for your work on this, unfortunately the work here is outdated and has been handled is separate issues elsewhere including:
- š Fix ESLint Errors following Drupal coding standards and best practices Active
- š Coding standards and best practices Active
If you have time, we could use your review the following issues if still open when you read this.
- š Delete unused color.js file and remove from library definitions. Active
- š Fix stylelint issues. Active