Problem/Motivation

When the environment_require_override option is enabled, the Status report page says "You should override the 'environment_override' variable in your settings.php file to indicate the server environment this site is in." regardless of if that variable is set or not.

Steps to reproduce

  1. Install Drupal with the Environment module.
  2. Navigate to the settings form at admin/config/system/environment/
  3. Enable "Require environment override" and click "Save".
  4. Navigate to the Status report page at admin/reports/status/. It should currently contain the message quoted above under "Environment Override".
  5. Add $conf['environment_override'] = 'development'; to settings.php.
  6. Clear cache and refresh the Status report page. It should no longer contain the message from #4, but it does.

This is because environment_requirements() (environment.install) always gives that message if the option from #3 is enabled.

Proposed resolution

Only give that message within environment_requirements() when the environment_override variable is not set in settings.php. When it is, return an OK status message.

Remaining tasks

I'll be attaching a patch that achieves the proposed resolution.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

guschilds’s picture

Status: Active » Needs review
FileSize
1.86 KB

Attached is a patch that solves the issue described in the issue summary above.

The patch applies directly to the 7.x-1.x branch.

Thanks for your work on this module!

arknoll’s picture

@guschilds thank you very much for the patch. I just made one small change to the patch. Marking RTBC and merging in.

arknoll’s picture

Status: Needs review » Reviewed & tested by the community

  • arknoll committed bb333f2 on 7.x-1.x authored by guschilds
    Issue #2492203 by guschilds: "Environment Override" is inaccurate on the...
arknoll’s picture

Status: Reviewed & tested by the community » Closed (fixed)