Skip to content

Commit 582e0ac

Browse files
committed
Merge branch 'ACP2E-2107' of https://github.com/magento-l3/magento2ce into PR-L3-2023-07-14
2 parents f7b4b14 + 67fb694 commit 582e0ac

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemErrors.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private function getItemErrors(Item $cartItem): ?array
7070
$errors = [];
7171
foreach ($cartItem->getErrorInfos() as $error) {
7272
$errorType = $error['code'] ?? self::ERROR_UNDEFINED;
73-
$message = $error['message'] ?? $cartItem->getMessage();
73+
$message = (string) ($error['message'] ?? $cartItem->getMessage());
7474
$errorEnumCode = $this->enumLookup->getEnumValueFromField(
7575
'CartItemErrorType',
7676
(string)$errorType

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/QuoteConfigurableProductInCartTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ public function testConfigurableProductInCartAfterGoesOutOfStock()
123123
value
124124
}
125125
}
126+
errors {
127+
code
128+
message
129+
}
126130
}
127131
}
128132
}
@@ -149,5 +153,6 @@ public function testConfigurableProductInCartAfterGoesOutOfStock()
149153
$response['cart']['items'][0]['product']['price_range']['maximum_price']['final_price']['value'],
150154
'Assert that maximum price equals to 0'
151155
);
156+
$this->assertEquals('ITEM_QTY', $response['cart']['items'][0]['errors'][0]['code']);
152157
}
153158
}

0 commit comments

Comments
 (0)