Skip to content

[Backport 2.3] Add swatch option: Prevent loosing data and default value if data is not populated via adminhtml #12044

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

Merged
merged 2 commits into from
Nov 27, 2017

Conversation

gomencal
Copy link
Contributor

@gomencal gomencal commented Nov 5, 2017

Add swatch option: Prevent loosing data and default value if data is not populated via adminhtml.

Description

Adapt \Magento\Swatches\Model\Plugin\EavAttribute::setProperOptionsArray to make possible that the plugins afterSave in the same module doesn't delete data if they don't found this data with all the options data, as sent via adminhtml form.

Fixed Issues (if relevant)

  1. Create attribute option via API for swatch attribute fails #10707: Create attribute option via API for swatch attribute fails
  2. Can't import attribute option over API if option is 'visual swatch' #10737: Can't import attribute option over API if option is 'visual swatch'
  3. Unable to add new options to swatch attribute #11032: Unable to add new options to swatch attribute
  4. Impossible to add swatch options via Service Contracts if there is no existing swatch option for attribute #9410: Impossible to add swatch options via Service Contracts if there is no existing swatch option for attribute

Manual testing scenarios

  1. Create a select attribute
  2. Make this attribute use visual or text swatch
  3. Try adding attribute options through the API via POST /V1/products/attributes/{attributeCode}/options

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@vkublytskyi vkublytskyi self-assigned this Nov 5, 2017
@vkublytskyi vkublytskyi added this to the November 2017 milestone Nov 5, 2017
@vkublytskyi vkublytskyi added Release Line: 2.3 2.2.x bug report Component: Catalog Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog labels Nov 5, 2017
@magento-engcom-team magento-engcom-team added bugfix Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch labels Nov 7, 2017
@vkublytskyi
Copy link

@gomencal Your tests in #12036 look good. May I ask you to port them to 2.3-develop as well. You may not port them to 2.1-develop if you have no time but it is highly desirable to be sure that after 2.3 release we will not have test coverage degradation.

@okorshenko okorshenko merged commit 8c61bc9 into magento:2.3-develop Nov 27, 2017
okorshenko pushed a commit that referenced this pull request Nov 27, 2017
… and default value if data is not populated via adminhtml #12044
@magento-engcom-team magento-engcom-team added Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line labels Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Award: test coverage bug report bugfix Component: Catalog Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Progress: accept Release Line: 2.3 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants