Skip to content

Commit f6b8e49

Browse files
some changes fixed
1 parent 2055291 commit f6b8e49

File tree

1 file changed

+12
-15
lines changed
  • app/code/Magento/Config/Block/System/Config

1 file changed

+12
-15
lines changed

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

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,7 @@ protected function _initElement(
366366

367367
$sharedClass = $this->_getSharedCssClass($field);
368368
$requiresClass = $this->_getRequiresCssClass($field, $fieldPrefix);
369-
$isReadOnly = $this->isDefaultFieldReadOnly($path);
370-
if (!$isReadOnly) {
371-
$isReadOnly = $this->getElementVisibility()->isDisabled($field->getPath())
372-
?: $this->getSettingChecker()->isReadOnly($path, $this->getScope(), $this->getStringScopeCode());
373-
}
369+
$isReadOnly = $this->getReadOnly($field, $path);
374370

375371
$formField = $fieldset->addField(
376372
$elementId,
@@ -801,20 +797,21 @@ private function getAppConfig()
801797
}
802798

803799
/**
804-
* Check Default Path Readonly
805-
*
800+
* Check Path is Readonly
801+
*
802+
* @param \Magento\Config\Model\Config\Structure\Element\Field $field
806803
* @param string $path
807804
* @return boolean
808805
*/
809-
private function isDefaultFieldReadOnly($path)
806+
private function getReadOnly(\Magento\Config\Model\Config\Structure\Element\Field $field, $path)
810807
{
811-
$scope = $this->getScope();
812-
$isReadOnly = false;
813-
if ($scope !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT) {
814-
$isReadOnly = $this->getSettingChecker()->isReadOnly(
815-
$path, ScopeConfigInterface::SCOPE_TYPE_DEFAULT
816-
);
817-
}
808+
$isReadOnly = $this->getSettingChecker()->isReadOnly(
809+
$path, ScopeConfigInterface::SCOPE_TYPE_DEFAULT
810+
);
811+
if (!$isReadOnly) {
812+
$isReadOnly = $this->getElementVisibility()->isDisabled($field->getPath())
813+
?: $this->getSettingChecker()->isReadOnly($path, $this->getScope(), $this->getStringScopeCode());
814+
}
818815
return $isReadOnly;
819816
}
820817

0 commit comments

Comments
 (0)