Skip to content

Commit 40aff3b

Browse files
committed
MC-29795: Some environment variables do not lock the settings in the backend
1 parent 9f2eede commit 40aff3b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/code/Magento/Config/Block/System/Config/Form/Field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected function _renderInheritCheckbox(\Magento\Framework\Data\Form\Element\A
9898
$htmlId = $element->getHtmlId();
9999
$namePrefix = preg_replace('#\[value\](\[\])?$#', '', $element->getName());
100100
$checkedHtml = $element->getInherit() == 1 ? 'checked="checked"' : '';
101-
$disabled = $element->getIsDisableInheritance() == true ? ' disabled="disabled"' : '';
101+
$disabled = $element->getIsDisableInheritance() == true ? ' disabled="disabled" readonly="1"' : '';
102102

103103
$html = '<td class="use-default">';
104104
$html .= '<input id="' .

app/code/Magento/Config/Test/Unit/Block/System/Config/Form/FieldTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function testRenderInheritCheckbox()
187187
'_inherit" name="' .
188188
$this->_testData['name'] .
189189
'[inherit]" type="checkbox" value="1"' .
190-
' class="checkbox config-inherit" checked="checked"' . ' disabled="disabled"' .
190+
' class="checkbox config-inherit" checked="checked"' . ' disabled="disabled"' . ' readonly="1"' .
191191
' onclick="toggleValueElements(this, Element.previous(this.parentNode))" /> ';
192192

193193
$expected .= '<label for="' . $this->_testData['htmlId'] . '_inherit" class="inherit">Use Website</label>';

lib/web/mage/adminhtml/form.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,8 @@ define([
494494
inputs.each(function (item) {
495495
// don't touch hidden inputs (and Use Default inputs too), bc they may have custom logic
496496
if ((!item.type || item.type != 'hidden') && !($(item.id + '_inherit') && $(item.id + '_inherit').checked) && //eslint-disable-line
497-
!(currentConfig['can_edit_price'] != undefined && !currentConfig['can_edit_price']) //eslint-disable-line
497+
!(currentConfig['can_edit_price'] != undefined && !currentConfig['can_edit_price']) && //eslint-disable-line
498+
!item.getAttribute('readonly') //eslint-disable-line
498499
) {
499500
item.disabled = false;
500501
jQuery(item).removeClass('ignore-validate');

0 commit comments

Comments
 (0)