Skip to content
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

Closed

Conversation

VitaliyBoyko
Copy link
Contributor

@VitaliyBoyko VitaliyBoyko commented Jul 26, 2018

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.

@magento-engcom-team magento-engcom-team added Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner labels Jul 26, 2018
@magento-engcom-team
Copy link
Contributor

Hi @VitaliyBoyko. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
protected $_settingsChecker;
Copy link
Contributor

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

Copy link
Contributor Author

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()
Copy link
Contributor

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?

Copy link
Contributor Author

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));

Copy link
Contributor Author

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.

@ihor-sviziev
Copy link
Contributor

Hi @VitaliyBoyko,
In general this PR looks good, but there are conflicts with 2.3-develop branch. Could you merge it?

@VitaliyBoyko
Copy link
Contributor Author

Hi @ihor-sviziev
The functionality which adds this pull request already implemented in code. This is the reason for conflicts. Closing this PS as a duplicate.

@VitaliyBoyko VitaliyBoyko deleted the Rework-for-PR-16222 branch August 16, 2018 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Config duplicate Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: needs update Release Line: 2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants