-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[Forwardport] Rework for PR #16222 #17168
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
[Forwardport] Rework for PR #16222 #17168
Conversation
Hi @VitaliyBoyko. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
/** | ||
* @var \PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
protected $_settingsChecker; |
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 use private, as in original PR
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.
Thanks. Done.
@@ -149,6 +158,41 @@ public function testSaveToCheckAdminSystemConfigChangedSectionEvent() | |||
$this->_model->save(); | |||
} | |||
|
|||
public function testDoNotSaveReadOnlyFields() |
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.
Why content of this method is different in original PR?
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 @ihor-sviziev
Thank you for review
In Magento 2.2 exist two additional calls of method Magento\Config\Model\Config\Structure\Element\Group::getElement
(check https://github.com/phoenix128/magento2/blob/af78c2fe5a02e5f521f1c984f303063544ef71f6/app/code/Magento/Config/Model/Config.php line 229 and 231) unlike Magento 2.3 implementation.
So in M2.3, we expect this method being invoked once as I've implemented.
$this->_configStructure->expects($this->once())
->method('getElement')
->with('section/1')
->will($this->returnValue($group));
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 believe this the only difference.
…-for-PR-16222 # Conflicts: # app/code/Magento/Config/Model/Config.php
Hi @VitaliyBoyko, |
Hi @ihor-sviziev |
Original PR: #16393
Description
When running 'app:config:dump', admin fields get disabled, but clicking save from backend will process them anyway.
This behavior causes a validation check on empty fields since the admin form fields are disabled and thus validation errors in many cases.
This PR checks when the field is read-only and skips its save.