@@ -366,11 +366,7 @@ protected function _initElement(
366
366
367
367
$ sharedClass = $ this ->_getSharedCssClass ($ field );
368
368
$ 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 );
374
370
375
371
$ formField = $ fieldset ->addField (
376
372
$ elementId ,
@@ -801,20 +797,21 @@ private function getAppConfig()
801
797
}
802
798
803
799
/**
804
- * Check Default Path Readonly
805
- *
800
+ * Check Path is Readonly
801
+ *
802
+ * @param \Magento\Config\Model\Config\Structure\Element\Field $field
806
803
* @param string $path
807
804
* @return boolean
808
805
*/
809
- private function isDefaultFieldReadOnly ( $ path )
806
+ private function getReadOnly ( \ Magento \ Config \ Model \ Config \ Structure \ Element \ Field $ field , $ path )
810
807
{
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
+ }
818
815
return $ isReadOnly ;
819
816
}
820
817
0 commit comments