-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Impossible to add swatch options via Service Contracts if there is no existing swatch option for attribute #9410
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
Comments
Hello! Did you try this solution? |
@TomashKhamlai, the solution you are linking does not answer my question. My bug report relates to Service Contracts and does not ask for a solution to actually add swatches. It's just a bug report :) Moreover, the solution you are providing does not make use of Service Contracts. |
Okay, I will answer you when internal ticket will be created. I also tried to test REST API for this functionality and I didn't get what I expected, however, I need some time to dive deeper into this problem. Thank you for reporting. |
Found this issue while trying to add swatches options in an import procedure. I ended up writing direct queries on the involved tables... Actually all the swatches module is a pile of weird things outside of Magento standards and needs to be extensively refactored. |
@herveguetin, thank you for your report. |
@herveguetin, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue. |
@magento-engcom-team With "can't reproduce" are you saying that you tried and |
The issue has been fixed and delivered to 2.2-develop and 2.1-develop branch. Will be available with upcoming patch release |
…eployment [Bengals] Functional Tests Mainline Deployment
Steps to reproduce
\Magento\Catalog\Api\ProductAttributeOptionManagementInterface::add
Expected result
The attribute from step 1 above should have a new swatch option.
Actual result
An exception is thrown: "Cannot save attribute [code of the attribute from step 1 above]"
This comes from
\Magento\Eav\Model\Entity\Attribute\OptionManagement::add
because, on\Magento\Swatches\Model\Plugin\EavAttribute::prepareOptionLinks
,$attributeSavedOptions[$optionCounter]
is never set ($attributeSavedOptions[1]
fails).Fix
\Magento\Swatches\Model\Plugin\EavAttribute::prepareOptionLinks
should be like this:Github extension while waiting for the fix to be implemented
https://github.com/herveguetin/Herve_SwatchOptionFix
The text was updated successfully, but these errors were encountered: