Closed
Description
Preconditions (*)
- 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 (*)
- Billing address expected to return in GraphQL response with full address details shown
Actual result (*)
- billing address returns as null.
- 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
- From Admin, go to Stores - Configuration - Customer - Customer Configuration - Name and Address Options. Set Show Telephone to Optional
- Using GraphQL mutation, add a product to Cart
- 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
}
}
}
}
}
- 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”.
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchMajor restrictions or short-term circumventions are required until a fix is available.Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Type
Projects
Status
Done