-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Issue #19609 FIXED #19880
Issue #19609 FIXED #19880
Conversation
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.
Hi @maheshWebkul721 , thanks for your contribution! Please take a look at the code review comments
@@ -366,9 +366,12 @@ protected function _initElement( | |||
|
|||
$sharedClass = $this->_getSharedCssClass($field); | |||
$requiresClass = $this->_getRequiresCssClass($field, $fieldPrefix); | |||
$isReadOnly = $this->isDefaultFieldReadOnly($path); |
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.
It would be nice to move all the readonly check to a private function
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 have fixed this, moved all checks in private function
{ | ||
$scope = $this->getScope(); | ||
$isReadOnly = false; | ||
if ($scope !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT) { |
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 think this check is unnecessary, $isReadOnly
value assigned inside the condition is correct for default scope
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.
Removed this check.
$isReadOnly = $this->isDefaultFieldReadOnly($path); | ||
if (!$isReadOnly) { | ||
$isReadOnly = $this->getElementVisibility()->isDisabled($field->getPath()) | ||
?: $this->getSettingChecker()->isReadOnly($path, $this->getScope(), $this->getStringScopeCode()); |
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.
Please consider injecting \Magento\Config\Model\Config\Reader\Source\Deployed\SettingChecker
as \Magento\Theme\Model\Design\Config\DataProvider::getSettingChecker
method is deprecated
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.
@sivaschenko do i need to inject \Magento\Config\Model\Config\Reader\Source\Deployed\SettingChecker
in constructor?
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.
Hi @maheshWebkul721 , yes, please
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.
@sivaschenko added!
Hi @maheshWebkul721 please add a new dependency in a backward compatible way, please see the |
@sivaschenko added constructor parameter as per contribution guide. |
Hi @maheshWebkul721, thank you for your contribution! |
Hi @maheshWebkul721. Thank you for your contribution. |
i have preposed a solution to fix #19609 issue, if there is configuration field lock entry available for
default scope then all scopes filed will be readonly.
Description (*)
Fixed Issues (if relevant)
Manual testing scenarios (*)
php bin/magento config:set --lock-config general/store_information/name "Test lock";
bin/magento config:set --scope=stores --scope-code=india --lock-config general/store_information/name "India"
Contribution checklist (*)