Skip to content
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

Fix Undefined index: option_value in GraphQL for configurable products #30937

Closed
wants to merge 3 commits into from

Conversation

peterjaap
Copy link
Contributor

@peterjaap peterjaap commented Nov 16, 2020

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Magento 2.3.4 graphql Notice: Undefined index: option_value in /var/www/html/mg234/vendor/magento/module-configurable-product-graph-ql/Model/Resolver/ConfigurableCartItemOptions.php on line 62 #28860

Manual testing scenarios (*)

  1. See Magento 2.3.4 graphql Notice: Undefined index: option_value in /var/www/html/mg234/vendor/magento/module-configurable-product-graph-ql/Model/Resolver/ConfigurableCartItemOptions.php on line 62 #28860

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 Nov 16, 2020

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

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added this to Pending Review in Pull Requests Dashboard Nov 16, 2020
@peterjaap peterjaap changed the title Update Configuration.php Fix Undefined index: option_value in GraphQL for configurable products Nov 16, 2020
@gabrieldagama gabrieldagama added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. labels Nov 26, 2020
@m2-community-project m2-community-project bot removed this from Pending Review in Pull Requests Dashboard Nov 26, 2020
@m2-community-project m2-community-project bot removed this from Pending Review in GraphQL Pull Requests Dashboard Nov 26, 2020
@rodrigowebjump rodrigowebjump self-assigned this Nov 27, 2020
@m2-community-project m2-community-project bot moved this from Pending Review to Review in Progress in High Priority Pull Requests Dashboard Nov 27, 2020
@rodrigowebjump
Copy link
Member

Hi @peterjaap Please could you check the Adobe CLA Sign?

Thanks

@rodrigowebjump
Copy link
Member

@magento run all tests

@peterjaap
Copy link
Contributor Author

@rodrigowebjump done

@gabrieldagama
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@gabrieldagama gabrieldagama left a comment

Choose a reason for hiding this comment

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

Hi @peterjaap, thanks for contributing! Can you cover this PR changes with automated tests? We can't proceed with delivery and approval without it.

Thank you!

@peterjaap
Copy link
Contributor Author

@gabrieldagama no thanks. I just needed the patchfile.

@engcom-Bravo
Copy link
Contributor

Hi @peterjaap
Thank you for your contribution,

We tried to reproduce the same on 2.4-develop, But its not reproducible.

Here the my GraphQL Request

mutation { addConfigurableProductsToCart( input: { cart_id: "hURmijr3leRFknQb4hZ2Ddugqjf6Bvoy" cart_items: [ { parent_sku: "MH01" data: { quantity: 1 sku: "MH01-XS-Black" } customizable_options: [ { id: 2, value_string: "3" } ] } ] } ) { cart { items { uid quantity product { name sku } ... on ConfigurableCartItem { customizable_options { label values { value } } configurable_options { option_label value_label value_id } } } } } }
Response
{ "data": { "addConfigurableProductsToCart": { "cart": { "items": [ { "uid": "Nw==", "quantity": 1, "product": { "name": "Chaz Kangeroo Hoodie", "sku": "MH01" }, "customizable_options": [ { "label": "Options", "values": [ { "value": "3" } ] } ], "configurable_options": [ { "option_label": "Color", "value_label": "Black", "value_id": 49 }, { "option_label": "Size", "value_label": "XS", "value_id": 166 } ] } ] } } } }

Hence closing this PR

You can try the same on mainline 2.4-develop, If still its reproducible, Please reopen and update if you wish to continue.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Insider: Elgentos community-insider-contribution Component: Catalog Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Project: GraphQL Release Line: 2.4 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
None yet
6 participants