Skip to content

Rest API is allowing duplication for attribute options and also always returning an empty option #10013

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

Closed
abdulmoizbaig opened this issue Jun 21, 2017 · 6 comments
Assignees
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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 triage wanted

Comments

@abdulmoizbaig
Copy link

abdulmoizbaig commented Jun 21, 2017

Preconditions:

  1. Magento 2.1.5 or 2.1.7

Steps to reproduce:

  1. Use this endpoint to add options for an attribute V1/products/attributes (catalogProductAttributeRepositoryV1) and trying adding similar values for each option's label.
  2. Use this endpoint to get options of attribute that you added in the step 1 V1/products/attributes/{id}/options (catalogProductAttributeOptionManagementV1)

Actual Result:

{"is_wysiwyg_enabled":"","is_html_allowed_on_front":"","used_for_sort_by":"","is_filterable":"","is_filterable_in_search":"","is_used_in_grid":"","is_visible_in_grid":"","is_filterable_in_grid":"","position":"0","apply_to":[],"is_searchable":"0","is_visible_in_advanced_search":"0","is_comparable":"0","is_used_for_promo_rules":"0","is_visible_on_front":"0","used_in_product_listing":"0","is_visible":"1","scope":"global","attribute_id":"136","attribute_code":"aaattribute","frontend_input":"select","entity_type_id":"4","is_required":"","options":[{"label":"","value":""},{"label":"ThisIsATestValue","value":"4"},{"label":"ThisIsATestValue","value":"5"},{"label":"ThisIsATestValue","value":"6"}],"is_user_defined":"1","default_frontend_label":"aaattribute","frontend_labels":"","backend_type":"int","source_model":"Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Table","default_value":"6","is_unique":"0","validation_rules":[]}

Expected result

{"is_wysiwyg_enabled":"","is_html_allowed_on_front":"","used_for_sort_by":"","is_filterable":"","is_filterable_in_search":"","is_used_in_grid":"","is_visible_in_grid":"","is_filterable_in_grid":"","position":"0","apply_to":[],"is_searchable":"0","is_visible_in_advanced_search":"0","is_comparable":"0","is_used_for_promo_rules":"0","is_visible_on_front":"0","used_in_product_listing":"0","is_visible":"1","scope":"global","attribute_id":"136","attribute_code":"aaattribute","frontend_input":"select","entity_type_id":"4","is_required":"","options":[{"label":"ThisIsATestValue","value":"4"}],"is_user_defined":"1","default_frontend_label":"aaattribute","frontend_labels":"","backend_type":"int","source_model":"Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Table","default_value":"6","is_unique":"0","validation_rules":[]}

Additional information

  1. It always returns an empty option as you can see ({"label":"","value":""}) in actual result.
  2. It should not add duplicates as you can see in actual result({"label":"ThisIsATestValue","value":"4"},{"label":"ThisIsATestValue","value":"5"},{"label":"ThisIsATestValue","value":"6"}) because its not allowed from admin panel too. It should say something like "already exist".
@veloraven
Copy link
Contributor

@abdulmoizbaig thank you for your feedback.
Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.
Please, also identify which version of Magento you are running.
Otherwise it's hard to understand what you are waiting to see and what actually happens.

@abdulmoizbaig abdulmoizbaig changed the title Rest API is allowing duplication of attribute options Rest API is allowing duplication for attribute options and also always returning an empty option Jul 25, 2017
@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Progress: needs update Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed Progress: needs update Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 labels Sep 20, 2017
@magento-engcom-team
Copy link
Contributor

@abdulmoizbaig, thank you for your report.
We've created internal ticket(s) MAGETWO-75549 to track progress on the issue.

@Fuzzzzy
Copy link

Fuzzzzy commented Oct 15, 2017

I'm working on it #SQUASHTOBERFEST

@magento-engcom-team
Copy link
Contributor

Hi @abdulmoizbaig

This ticket has been marked as "Triage Wanted" due to low user involvement over time. Over the next 2 weeks we are looking for additional community feedback to decide if it should be archived or not. More information on this is available on the GitHub wiki.

Thank you for collaboration.

@magento-engcom-team
Copy link
Contributor

@abdulmoizbaig, thank you for your report.

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

You may learn more about this initiative following this link.

Please feel free to comment or reopen the ticket if you think it should be reviewed once more. Thank you for collaboration.

@alexandrosk
Copy link

@abdulmoizbaig Hey Abdul, did you remember what you did to fix this? I'm having the exact same issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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 triage wanted
Projects
None yet
Development

No branches or pull requests

6 participants