File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Test/Unit/Block/System/Config Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -366,9 +366,12 @@ 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
374
370
- $ isReadOnly = $ this ->getElementVisibility ()->isDisabled ($ field ->getPath ())
371
- ?: $ this ->getSettingChecker ()->isReadOnly ($ path , $ this ->getScope (), $ this ->getStringScopeCode ());
372
375
$ formField = $ fieldset ->addField (
373
376
$ elementId ,
374
377
$ field ->getType (),
@@ -797,6 +800,24 @@ private function getAppConfig()
797
800
return $ this ->appConfig ;
798
801
}
799
802
803
+ /**
804
+ * Check Default Path Readonly
805
+ *
806
+ * @param string $path
807
+ * @return boolean
808
+ */
809
+ private function isDefaultFieldReadOnly ($ path )
810
+ {
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
+ }
818
+ return $ isReadOnly ;
819
+ }
820
+
800
821
/**
801
822
* Retrieve deployment config data value by path
802
823
*
Original file line number Diff line number Diff line change @@ -532,7 +532,7 @@ public function testInitFields(
532
532
533
533
$ elementVisibilityMock = $ this ->getMockBuilder (ElementVisibilityInterface::class)
534
534
->getMockForAbstractClass ();
535
- $ elementVisibilityMock ->expects ($ this ->once ())
535
+ $ elementVisibilityMock ->expects ($ this ->any ())
536
536
->method ('isDisabled ' )
537
537
->willReturn ($ isDisabled );
538
538
You can’t perform that action at this time.
0 commit comments