Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Notice: Undefined offset: 1 in app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddress/SelectedShippingMethod.php on line 35 #657

Closed
TomashKhamlai opened this issue May 2, 2019 · 0 comments
Assignees
Labels
bug Something isn't working Checkout Component: QuoteGraphQl Contribution Day Tickets is good for start on Contribution Day good first issue Good for newcomers

Comments

@TomashKhamlai
Copy link
Contributor

Preconditions (*)

  1. No preconditions

Steps to reproduce (*)

  1. Create empty cart and copy cart_id to the step 5
  2. Add simple product
  3. Set shipping address on cart
  4. Try this magic: copy the request body and do not prettify it (one line request)
mutation setBillingAddressOnCart($cart_id: String! $firstname: String! $lastname: String! $street_lines: [String] !$city: String! $region: String! $postcode: String! $country_code: String! $telephone: String!) { setBillingAddressOnCart(input: { cart_id: $cart_id billing_address: { address: { firstname: $firstname lastname: $lastname street: $street_lines city: $city region: $region postcode: $postcode country_code: $country_code telephone: $telephone save_in_address_book: false } } }) { cart { shipping_addresses { postcode region { label code } selected_shipping_method { carrier_code method_code } } billing_address { postcode city region { label code } } available_payment_methods { code title } } } }
  1. Copy variables:
{
      "postcode" : "90230",
      "telephone" : "555-555-55-55",
      "street_lines" : [
         "6161 West Centinella Avenue"
      ],
      "region" : "CA",
      "lastname" : "Doe",
      "city" : "Culver City",
      "cart_id" : "{{ cart_id }}",
      "firstname" : "John",
      "country_code" : "us"
   }
  1. Send

Expected result (*)

  1. Validation

Actual result (*)

  1. Internal Server Error
{
  "errors": [
    {
      "debugMessage": "Notice: Undefined offset: 1 in /var/www/html/m2-test/app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddress/SelectedShippingMethod.php on line 35",
      "message": "Internal server error",
      "category": "internal",
      "locations": [
        {
          "line": 10,
          "column": 9
        }
      ],
      "path": [
        "setBillingAddressOnCart",
        "cart",
        "shipping_addresses",
        0,
        "selected_shipping_method"
      ]
    }
  ],
  "data": {
    "setBillingAddressOnCart": {
      "cart": {
        "shipping_addresses": [
          {
            "postcode": "90230",
            "region": {
              "label": "CA",
              "code": null
            },
            "selected_shipping_method": null
          }
        ],
        "billing_address": {
          "postcode": "90230",
          "city": "Culver City",
          "region": {
            "label": "CA",
            "code": "CA"
          }
        },
        "available_payment_methods": [
          {
            "code": "checkmo",
            "title": "Check / Money order"
          }
        ]
      }
    }
  }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Checkout Component: QuoteGraphQl Contribution Day Tickets is good for start on Contribution Day good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants