QUALITY PATCH

MDVA-39521: The user is not able to set shipping address on the carts with an empty telephone number…

The user is not able to set shipping address on the carts with an empty telephone number via GraphQL despite the fact that the Show Telephone is configured as optional. Quality patch MDVA-39521 for magento/module-customer applies to Magento Open Source and Adobe Commerce 2.4.0 to 2.4.3-p3.

Categories
GraphQL
Components
magento/module-customer, magento/module-quote-graph-ql
Origin
adobe-commerce-support
Since QPT
1.1.2

Issue

The user is not able to set shipping address on the carts with an empty telephone number via GraphQL despite the fact that the Show Telephone is configured as optional.

Steps to reproduce

1. Create a simple product. 1. Go to Stores > Configuration > Customers > Customer Configuration > Name and Address Options and set the Show Telephone as Optional. 1. Create an empty cart via GraphQL request. mutation { createEmptyCart } 1. Add product to cart. mutation { addSimpleProductsToCart( input: { cart_id: "{ CART_ID }" cart_items: [ { data: { quantity: 1 sku: "24-MG04" } } ] } ) { cart { items { id product { sku stock_status } quantity } } } } 1. Add address: GRAPHQL VARIABLES. { "cartId": "6Efw00UbjPoP5cvTFhsswDTjpxs0Xupt" } mutation ($cartId: String!) { setShippingAddressesOnCart(input: {cart_id: $cartId, shipping_addresses: {address: {firstname: "John", lastname: "Doe", company: "Company Name", street: ["820 Burrard Street"], city: "Vancouver", region: "BC", postcode: "V6Z 2J1", country_code: "CA", telephone: "123-456-0000", save_in_address_book: false}}}) { cart { shipping_addresses { firstname lastname company street city postcode telephone country { code label } } } } } Result: { "data": { "setShippingAddressesOnCart": { "cart": { "shipping_addresses": [ { "firstname": "John", "lastname": "Canada", "company": "Company Name", "street": [ "820 Burrard Street" ], "city": "Vancouver", "postcode": "V6Z 2J1", "telephone": "123-456-0000", "country": { "code": "CA", "label": "CA" } } ] } } } } 1. Add address with empty phone number. mutation ($cartId: String!) { setShippingAddressesOnCart(input: {cart_id: $cartId, shipping_addresses: {address: {firstname: "John", lastname: "Canada", company: "Company Name", street: ["820 Burrard Street"], city: "Vancouver", region: "BC", postcode: "V6Z 2J1", country_code: "CA", telephone: "123-456-0000", save_in_address_book: false}}}) { cart { shipping_addresses { firstname lastname company street city postcode telephone country { code label } } } } }

Adobe's page lists 2.4.0 - 2.4.3 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Adobe scheduled the permanent fix for 2.4.4.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply MDVA-39521. On Cloud, add MDVA-39521 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its MDVA-39521/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (2): magento/module-customer, magento/module-quote-graph-ql
Packages across compatible versions (2): magento/module-customer, magento/module-quote-graph-ql

magento/magento2-base >=2.4.0 <2.4.4

Magento Open Source
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3, 2.4.2-p2, 2.4.2-p1, 2.4.2, 2.4.1-p1, 2.4.1, 2.4.0-p1, 2.4.0
Adobe Commerce
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3, 2.4.2-p2, 2.4.2-p1, 2.4.2, 2.4.1-p1, 2.4.1, 2.4.0-p1, 2.4.0
Patch file
patches/os/MDVA-39521_2.4.2-p1.patch
  • vendor/magento/module-customer/Model/Config/Backend/Show/Customer.php
  • vendor/magento/module-quote-graph-ql/etc/schema.graphqls

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.