Skip to content

Resolve API create /V1/products/attribute-sets/groups ("sort_order" and "attribute_group_code") not changing. #23690

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

Conversation

edenduong
Copy link
Contributor

@edenduong edenduong commented Jul 13, 2019

Description (*)

#23634: Resolve API create /V1/products/attribute-sets/groups two fields (sort_order and "attribute_group_code" field) not changing in the DataBase. Remember check in the Database, because the API always return the "sort_order" and "attribute_group_code" which is sent in the body parameter of request.

Solution: The reason is in the save() function, it doesn't get the value in the extension_attributes. To fix it, in the save() function of repository, we need to get the value in the extension_attributes and add them to the model.

Fixed Issues (if relevant)

  1. Eav Group Repository Order not changing. #23634: Eav Group Repository Order not changing.

Manual testing scenarios (*)

Call the API:
Method: POST
http://[magento2 domain]/rest/default/V1/integration/admin/token
{"username":"admin","password":"123123q"}

The result is the [TOKEN]

Method: POST
http://[magento 2 domain]/rest/default/V1/products/attribute-sets/groups
Authorization: Bearer [TOKEN]

{
  "group": {
    "attribute_group_name": "Product Details",
    "attribute_set_id": "3",
    "extension_attributes": {
      "attribute_group_code": "details-test",
      "sort_order": "50"
    }
  }
}

Check in the Database, the last record in the table "eav_attribute_group". The attribute_group_code : "details-test" and "sort_order": "50" are saved correctly.

Remember check in the Database, because the API always return the "sort_order" and "attribute_group_code" which is sent in the body parameter of request.

Questions or comments

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 are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 13, 2019

Hi @edenduong. 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

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

@edenduong edenduong changed the title Resolve API create /V1/products/attribute-sets/groups (order and group code field) not changing. Resolve API create /V1/products/attribute-sets/groups ("sort_order" and "attribute_group_code") not changing. Jul 13, 2019
@edenduong edenduong force-pushed the 2.3-bugfix/eav_group_order_group_code_not_change_issue23634 branch from 6732ee1 to f46fc24 Compare July 13, 2019 15:46
@edenduong edenduong closed this Jul 13, 2019
@edenduong edenduong force-pushed the 2.3-bugfix/eav_group_order_group_code_not_change_issue23634 branch from f46fc24 to aa25ca5 Compare July 13, 2019 15:49
@m2-assistant
Copy link

m2-assistant bot commented Jul 13, 2019

Hi @edenduong, 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.

@edenduong edenduong reopened this Jul 13, 2019
@edenduong edenduong force-pushed the 2.3-bugfix/eav_group_order_group_code_not_change_issue23634 branch 2 times, most recently from f26bf58 to 3a05949 Compare July 14, 2019 01:04
@edenduong
Copy link
Contributor Author

@magento give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @edenduong. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @edenduong, here is your new Magento instance.
Admin access: https://pr-23690.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@edenduong edenduong force-pushed the 2.3-bugfix/eav_group_order_group_code_not_change_issue23634 branch from 98e29ed to fcd05c6 Compare July 14, 2019 13:45
@orlangur orlangur self-assigned this Jul 15, 2019
@edenduong
Copy link
Contributor Author

Hi @orlangur : Could you please review my pull request?

…nd "attribute_group_code") not changing. issue 23634
@edenduong edenduong force-pushed the 2.3-bugfix/eav_group_order_group_code_not_change_issue23634 branch from b2a1dec to 79410c8 Compare July 28, 2019 12:41
@sivaschenko sivaschenko removed their request for review August 9, 2019 18:22
@edenduong edenduong requested a review from swnsma August 13, 2019 08:34
@ghost ghost assigned swnsma Aug 14, 2019
@swnsma swnsma added Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Award: bug fix labels Aug 14, 2019
@magento-engcom-team
Copy link
Contributor

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

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

screen

Before:
before

After:
after

@engcom-Foxtrot engcom-Foxtrot self-assigned this Aug 16, 2019
magento-engcom-team pushed a commit that referenced this pull request Aug 19, 2019
…sort_order" and "attribute_group_code") not changing. #23690
@magento-engcom-team magento-engcom-team merged commit 79410c8 into magento:2.3-develop Aug 19, 2019
@m2-assistant
Copy link

m2-assistant bot commented Aug 19, 2019

Hi @edenduong, 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.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.4 milestone Aug 19, 2019
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.

6 participants