Merge pull request #11086 from agileware/CRM-21277
[civicrm-core.git] / CRM / Admin / Form / Setting / Debugging.php
index 5a065c567ad36ef337bf8c4a7e15673d0186df11..6ab965f4f58b890e88d38c2b2a965158d4ec4a8b 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017                                |
+ | Copyright CiviCRM LLC (c) 2004-2018                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
  */
 
 /**
@@ -54,8 +54,7 @@ class CRM_Admin_Form_Setting_Debugging extends CRM_Admin_Form_Setting {
     }
 
     parent::buildQuickForm();
-
-    if (defined('CIVICRM_ENVIRONMENT')) {
+    if (Civi::settings()->getMandatory('environment') !== NULL) {
       $element = $this->getElement('environment');
       $element->freeze();
       CRM_Core_Session::setStatus(ts('The environment settings have been disabled because it has been overridden in the settings file.'), ts('Environment settings'), 'info');