-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-21777 - Set readonly for the fields initialised in civicrm_settings.php #11680
Conversation
CRM/Admin/Form/Setting.php
Outdated
@@ -95,6 +95,8 @@ public function buildQuickForm() { | |||
|
|||
$descriptions = array(); | |||
$settingMetaData = $this->getSettingsMetaData(); | |||
//Load readonly for the input fields whose values are overridden in civicrm_settings.php. | |||
$overriddenSettings = CRM_Utils_Array::value('civicrm_setting', $GLOBALS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would remove this and in 110 use something like Civi::settings()->getMandatory($setting);
that should tell you if its overrriden i think iirc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed and updated. Thanks 👍
65faf2b
to
b6470c3
Compare
b6470c3
to
f6c21a4
Compare
@jitendrapurohit I think this is same as https://issues.civicrm.org/jira/browse/CRM-21495 |
@@ -147,6 +152,9 @@ public function buildQuickForm() { | |||
|
|||
} | |||
} | |||
if (!empty($setStatus)) { | |||
CRM_Core_Session::setStatus("Some fields are loaded as 'readonly' as they have been set (overridden) in civicrm.settings.php.", '', 'info', array('expires' => 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jitendrapurohit This string is missing ts()
for translation. Could you do a follow-up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overview
Load input fields as non-editable which have been initialized in
civicrm.settings.php
.Before
Directory Preference
ORResource URL
settings initialized in civi settings file are shown as editable incivicrm/admin/setting/path?reset=1
ORcivicrm/admin/setting/url?reset=1
form. If a user tries to edit and update the path, it is not saved as value which is already set in civicrm.settings.php gets the preference. Check JIRA for more details.After
Fields initialized in
civicrm.settings.php
are loaded as readonly as it is of no use to load them as editable. Also, a warning is displayed which lets the user know that some fields are already set (overridden) in settings file.