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

GraphQL returns null address if optional telephone is set as empty string #30218

Closed
4 tasks
Magepim opened this issue Sep 28, 2020 · 23 comments · Fixed by #30982
Closed
4 tasks

GraphQL returns null address if optional telephone is set as empty string #30218

Magepim opened this issue Sep 28, 2020 · 23 comments · Fixed by #30982
Assignees
Labels
Component: CustomerGraphQl Component: SalesGraphQl Event: dmcdindia2020 Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@Magepim
Copy link

Magepim commented Sep 28, 2020

Preconditions (*)

  1. Version 2.4.0 and 2.4-develop

Steps to reproduce (*)

1.Configure Magento address settings to have telephone number as optional.
2. Using GraphQL add a billing address to a quote using an empty string as the telephone value
3. Execute cart query via GraphQL. Billing address will return as 'null'

Expected result (*)

  1. Billing address expected to return in GraphQL response with full address details shown

Actual result (*)

  1. billing address returns as null.
  2. This is caused because the telephone field in the CartAddressInput in the GraphQL schema is marked as non-nullable. Magento saved the telephone value as null in the quote address when it is passed an empty string. The address is then validated against the schema when the response is being prepared and fails the schema validation.

Additional info from Engcom

Steps to reproduce

  1. From Admin, go to Stores - Configuration - Customer - Customer Configuration - Name and Address Options. Set Show Telephone to Optional
    show_telephone
  2. Using GraphQL mutation, add a product to Cart
  3. Set Billing Address on cart using the following Mutation
mutation {
  setBillingAddressOnCart(
    input: {
      cart_id: "YOrpn8PaE1sNO88W4KTqGlMu1UB6Rpoh"
      billing_address: {
        address: {
          firstname: "Bob"
          lastname: "Roll"
          company: "Magento"
          street: [
            "Magento Pkwy"
            "Main Street"
          ]
          city: "Austin"
          region: "TX"
          postcode: "78758"
          telephone: ""        #<---- note that the telephone is an empty string. 
          country_code: "US"
          save_in_address_book: true
        }
        same_as_shipping: false
      }
    }
  ) {
    cart {
      billing_address {
        firstname
        lastname
        company
        street
        city
        region {
          code
          label
        }
        postcode
        telephone
        country {
          code
          label
        }
      }
    }
  }
}
  1. Query Cart
query{
  cart(cart_id: "YOrpn8PaE1sNO88W4KTqGlMu1UB6Rpoh"){
    billing_address{
      city
      firstname
      lastname
      telephone
      region{
        code
      }
      street
    }
    items{
      id
      quantity
      product{
        name
      }
    }
  }
}

Actual Result
Cart query displayed Billing Adress as null

{
  "data": {
    "cart": {
      "billing_address": null,
      "items": [
        {
          "id": "1",
          "quantity": 3,
          "product": {
            "name": "Sproduct"
          }
        }
      ]
    }
  }
}

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [X ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Sep 28, 2020

Hi @Magepim. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

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

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues 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 issues 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 Ready for Grooming in Low Priority Backlog Sep 28, 2020
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 28, 2020
@Magepim
Copy link
Author

Magepim commented Sep 28, 2020

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@Magepim
Copy link
Author

Magepim commented Sep 28, 2020

@magento I am working on this

@m2-assistant
Copy link

m2-assistant bot commented Sep 28, 2020

Hi @Magepim! 👋
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

@Magepim
Copy link
Author

Magepim commented Sep 28, 2020

@magento add to contributors team

@m2-assistant
Copy link

m2-assistant bot commented Sep 28, 2020

Hi @Magepim! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and add your comment one more time.

@Magepim
Copy link
Author

Magepim commented Sep 28, 2020

@magento I am working on this

@ashish-viradiya
Copy link

@magento I am working on this.

@ashish-viradiya
Copy link

#dmcdindia2020

@ashish-viradiya ashish-viradiya removed their assignment Oct 10, 2020
@sidolov sidolov added this to Ready for Confirmation in Issue Confirmation and Triage Board Oct 20, 2020
@ghost ghost removed this from Dev In Progress in Low Priority Backlog Oct 20, 2020
@ghost ghost added Issue: ready for confirmation and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 20, 2020
@ghost ghost unassigned Magepim Oct 23, 2020
@engcom-Bravo engcom-Bravo self-assigned this Oct 30, 2020
@m2-assistant
Copy link

m2-assistant bot commented Oct 30, 2020

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo
Copy link
Contributor

The issue is reproducible on the latest 2.4-develop. Additional info from Engcom is added to the description

@gabrieldagama gabrieldagama added the Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. label Nov 3, 2020
@ghost ghost added this to Ready for Development in High Priority Backlog Nov 3, 2020
@ghost ghost removed this from Confirmed in Issue Confirmation and Triage Board Nov 3, 2020
@magento-engcom-team magento-engcom-team added the Reported on 2.4.0 Indicates original Magento version for the Issue report. label Nov 13, 2020
@SaftaArtem
Copy link

@magento add to contributors team

@m2-assistant
Copy link

m2-assistant bot commented Nov 18, 2020

Hi @SaftaArtem! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and add your comment one more time.

@SaftaArtem
Copy link

@magento I am working on this

@SaftaArtem
Copy link

@magento give me test instance

@magento-deployment-service
Copy link

Hi @SaftaArtem. Thank you for your request. Comments like @magento give me test instance are intended for instance deployments on Pull Requests. Please use comment like: @magento give me 2.4-develop instance to request an instance on an issue.

@SaftaArtem
Copy link

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@SaftaArtem
Copy link

@magento run all tests

SaftaArtem pushed a commit to SaftaArtem/magento2-1 that referenced this issue Nov 20, 2020
SaftaArtem pushed a commit to SaftaArtem/magento2-1 that referenced this issue Nov 20, 2020
…d setting, new address without telephone."

This reverts commit 04c9e4a
SaftaArtem pushed a commit to SaftaArtem/magento2-1 that referenced this issue Nov 20, 2020
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Done in High Priority Backlog Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CustomerGraphQl Component: SalesGraphQl Event: dmcdindia2020 Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Development

Successfully merging a pull request may close this issue.

7 participants