Skip to content

2.3 only - creating attribute option value using API returns unexpected response #18392 #19108

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
wants to merge 8 commits into from
Closed

2.3 only - creating attribute option value using API returns unexpected response #18392 #19108

wants to merge 8 commits into from

Conversation

Nazar65
Copy link
Member

@Nazar65 Nazar65 commented Nov 7, 2018

Description (*)

Return value should be the ID of the new option

Fixed Issues (if relevant)

  1. 2.3 only - creating attribute option value using API returns unexpected response #18392: 2.3 only - creating attribute option value using API returns unexpected response

Manual testing scenarios (*)

  1. Setup a clean Magento installation
  2. Create an Integration with full access rights & activate it, I'm assuming the access token is abcd (see step 4)
  3. Using the adminhtml, create a new dropdown product attribute, use attribute code: dropdown
  4. Add an option through a REST call (make sure to use an option which doesn't exist yet):
    curl -k -X POST "https://domain.tld/rest/all/V1/products/attributes/dropdown/options" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer abcd" -d "{ \"option\": { \"label\": \"whatever\" }}
  5. Value should be the ID of the new option

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)

@magento-engcom-team
Copy link
Contributor

Hi @Nazar65. 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 2.3-develop instance - deploy vanilla Magento instance

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

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Nov 8, 2018
@magento-engcom-team
Copy link
Contributor

Hi @VladimirZaets, thank you for the review.
ENGCOM-3413 has been created to process this Pull Request

\Magento\Eav\Model\ResourceModel\Entity\Attribute $resourceModel
AttributeRepository $attributeRepository,
Attribute $resourceModel,
GetAttributeOptionId $getAttributeOptionId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, inject new dependencies according to our Backward Compatible Development Guide

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Nazar65
Copy link
Member Author

Nazar65 commented Jan 18, 2019

Hi @sidolov all done.

@@ -14,6 +14,7 @@
use Magento\Framework\Exception\InputException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Exception\StateException;
use \Magento\Framework\App\ObjectManager;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first \ can be removed here so it's consistent with the use statements above it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hostep Thanks for some reason I did not see it right away

remove "\" from use Object Manager
@Nazar65
Copy link
Member Author

Nazar65 commented Mar 12, 2019

after some changes in 2.3-develop now we have "returned id of option". So no need anymore this PR. Created at on Nov 7, 2018 😕
screen

@Nazar65 Nazar65 closed this Mar 12, 2019
@ghost
Copy link

ghost commented Mar 12, 2019

Hi @Nazar65, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants