-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Can't import attribute option over API if option is 'visual swatch' #10737
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
We are closing this issue because we cannot reproduce this issue as described. If you have questions, please refer to a question and answer site, such as Stack Exchange and the Magento Forums, where Magento community members can quickly provide recommendations and advice. |
It seems that's the same problem as #10707, could you leave the issue open until it's solved? |
@slavkodick why keep two issues for the same problem open? |
i am also facing same issue could not find node to add hex code or image url: http://{domain_name}/index.php/rest/V1/products/attributes/{attribute_code}/options
|
Reopening for recheck by @magento-engcom-team. |
@slavkodick, thank you for your report. |
@magento-admin @magento-devops @magento-engcom-team I am facing the same issue. In Postman we are sending a soap request to create a new 'option' for a text/swatch attribute. With Magento 2.2.4 I am getting the error "Cannot save attribute %1". With Magento 2.2.0 I am getting response "true" but the option is not being created in Magento. See here |
@magento-engcom-team Since you are unable to reproduce, please explain how you add an option with a hex code to an swatch attribute by using the rest api. YOU WILL NOT BE ABLE TO DO THIS, thats how you reproduce it. Next time please read the issue fully. |
This is completely ridiculous!! |
This has been reproduced on a vanilla 2.3.3 installation running the standard demo data/Luma theme: Steps to reproduce:
Example Payload
|
Hi @engcom-Delta. Thank you for working on this issue.
|
Hi guys,
|
Hi @harperruss, thank you for your report. Unfortunately, I am not able to reproduce issue by steps you described on clean 2.4-develop. Manual testing scenario:
Result: Are you still facing this issue on the latest |
@engcom-Delta If you don't send the "value" in the payload or try null or "" it will not create a record in eav_attribute_option_swatch. We are using visual swatches but the image is coming from the swatch image attribute attached to the product not as a hex colour defined against the attribute:
Or
Or
This is on 2.3.3 not 2.4 |
@harperruss could reproduce the issue in |
@diazwatson It looks like this has been fixed in 2.3.4 https://devdocs.magento.com/guides/v2.3/release-notes/release-notes-2-3-4-open-source.html#swatches |
@harperruss it looks like, although it does not mention the commit where this was fixed, so we cannot see what was the actual fix. Is it possible for you to test in 2.3.4? |
@harperruss how do you attach the Swatch image to the option? |
@vincentteyssier No idea I'm afraid, it's not something I have needed to do |
@harperruss if only they would have proper doc... |
Guys I am closing this issue as it seems to be fixed. |
Preconditions
Steps to reproduce
Import Attribute Option of type visual swatch (Color for example) over http request (API)
Code example:
{
$option = $this->attrOptionFactory->create();
$optionLabel = $this->attrOptionLabelFactory->create();
}
Expected result
Actual result
More info
Until Magento 2.1.7 the plugin did not trigger beforeSave function in swatches/Model/Plugin/EavAttribute and the Import data had not to match visual swatch data structure, it was imported
Since Magento 2.1.8 the function is renamed to beforeBeforeSave and the plugin triggers it,
so the Import data has to follow data structure of visual swatch, but since it is a API Import there is no entry in database and the new Option does not get imported
The text was updated successfully, but these errors were encountered: