diff --git a/.changeset/good-rocks-matter.md b/.changeset/good-rocks-matter.md new file mode 100644 index 0000000000..74ff8ac708 --- /dev/null +++ b/.changeset/good-rocks-matter.md @@ -0,0 +1,5 @@ +--- +"@graphcommerce/docs": patch +--- + +Update Magento known issues diff --git a/docs/magento/known-issues.md b/docs/magento/known-issues.md index 9031be4835..bf386f3f6d 100644 --- a/docs/magento/known-issues.md +++ b/docs/magento/known-issues.md @@ -10,7 +10,7 @@ An overview of bugs and limitations you may run into with Magento's GraphQL API: Affected Magento versions: -- `2.4.7`: only `2.4.7-beta1` +- `2.4.7`: fixed after 2.4.7-beta1 - `2.4.6`: all versions This is caused by a regression which results in some GraphQL errors no longer @@ -24,6 +24,72 @@ As a workaround, you can apply See also https://github.com/magento/magento2/commit/49cbe774020d3dfa6ee2b8702376a947801c9971 +## After adding a product to cart with custom options, options are not saved and/or retrieving the cart results in an error + +Affected Magento versions: + +- `2.4.7`: unknown, see below +- `2.4.6`: all versions + +When adding a product to cart, custom options are not processed and saved +correctly, and can result in an error on the `Cart.items.errors.message` field +when subsequently retrieving the cart, if the product had required custom +options. + +The observed error happens because no value is given for the non-nullable +`message` field, however the original error occurs due a required custom option +not being present on the cart item, as the custom options we not saved correctly +during the previous `addProductsToCart` call. + +Note that although the relevant PR for this fix was merged, the fix seems to +have gotten reverted and is not present in 2.4-develop at the time of writing, +and may not be included in the final release of 2.4.7. + +As a workaround, you can apply +[fix-custom-option-processing.patch](./patches/fix-custom-option-processing.patch). + +See also: + +- Original PR: https://github.com/magento/magento2/issues/37599 +- PR regarding revert of fix: https://github.com/magento/magento2/issues/37928 + +## Adding products to cart with pre-existing items that are out of stock always results in an error + +Affected Magento versions: + +- `2.4.7`: fixed after 2.4.7-beta2 +- `2.4.6`: all versions + +This is due to an inconsistency between errors that are reported through the +`AddProductsToCartOutput.user_errors` field and those on the cart items, which +make it impossible to differentiate between errors cause by the product that was +being added, and those from pre-existing cart items. + +As a workaround you can apply +[fix-cart-user-error-reporting.patch](./patches/fix-cart-user-error-reporting.patch). + +See also: + +- Issue: https://github.com/magento/magento2/issues/37908 +- PR with fix: https://github.com/magento/magento2/pull/38014/files + +## Bundle selection products are not shown due to their visibility setting + +Affected Magento versions: + +- `2.4.6`: all versions + +The `BundleItemOption.product` GraphQL field is returned as `null` if the +product visibility is set to not be visible in the catalog (which you may not +want). + +As a workaround you can apply the following patches: + +- [fix-bundle-selection-visibility-catalog.patch](./patches/fix-bundle-selection-visibility-catalog.patch) +- [fix-bundle-selection-visibility-related.patch](./patches/fix-bundle-selection-visibility-related.patch) + +See also https://github.com/magento/magento2/issues/37774 + ## Next steps - [Overview](./readme) diff --git a/docs/magento/patches/fix-bundle-selection-visibility-catalog.patch b/docs/magento/patches/fix-bundle-selection-visibility-catalog.patch new file mode 100644 index 0000000000..3edd69cf60 --- /dev/null +++ b/docs/magento/patches/fix-bundle-selection-visibility-catalog.patch @@ -0,0 +1,17 @@ +Fix bundle product children not showing up on some products, see https://github.com/magento/magento2/issues/37774 + +@package magento/module-catalog-graph-ql + +diff --git a/Model/Resolver/Products/DataProvider/Product.php b/Model/Resolver/Products/DataProvider/Product.php +index 30be41072242b..3e955ae303453 100644 +--- a/Model/Resolver/Products/DataProvider/Product.php ++++ b/Model/Resolver/Products/DataProvider/Product.php +@@ -89,7 +89,7 @@ public function getList( + + $this->collectionPreProcessor->process($collection, $searchCriteria, $attributes, $context); + +- if ($isChildSearch) { ++ if (!$isChildSearch) { + $visibilityIds = $isSearch + ? $this->visibility->getVisibleInSearchIds() + : $this->visibility->getVisibleInCatalogIds(); diff --git a/docs/magento/patches/fix-bundle-selection-visibility-related.patch b/docs/magento/patches/fix-bundle-selection-visibility-related.patch new file mode 100644 index 0000000000..c7265e8023 --- /dev/null +++ b/docs/magento/patches/fix-bundle-selection-visibility-related.patch @@ -0,0 +1,19 @@ +Fix bundle product children not showing up on some products, see https://github.com/magento/magento2/issues/37774 + +@package magento/module-related-product-graph-ql + +diff --git a/Model/Resolver/Batch/AbstractLikedProducts.php b/Model/Resolver/Batch/AbstractLikedProducts.php +index fac7b23d408e3..f35af6f4885d2 100644 +--- a/Model/Resolver/Batch/AbstractLikedProducts.php ++++ b/Model/Resolver/Batch/AbstractLikedProducts.php +@@ -94,9 +94,7 @@ private function findRelations(array $products, array $loadAttributes, int $link + $this->searchCriteriaBuilder->addFilter('entity_id', $relatedIds, 'in'); + $relatedSearchResult = $this->productDataProvider->getList( + $this->searchCriteriaBuilder->create(), +- $loadAttributes, +- false, +- true ++ $loadAttributes + ); + //Filling related products map. + /** @var \Magento\Catalog\Api\Data\ProductInterface[] $relatedProducts */ diff --git a/docs/magento/patches/fix-cart-user-error-reporting.patch b/docs/magento/patches/fix-cart-user-error-reporting.patch new file mode 100644 index 0000000000..767836706b --- /dev/null +++ b/docs/magento/patches/fix-cart-user-error-reporting.patch @@ -0,0 +1,21 @@ +Fix add to cart `user_error` field containing inconsistent errors. See https://github.com/magento/magento2/pull/38014 + +@package magento/module-quote + +--- a/Model/Cart/AddProductsToCart.php ++++ b/Model/Cart/AddProductsToCart.php (date 1696845624268) +@@ -80,14 +80,6 @@ + $cartId = $this->maskedQuoteIdToQuoteId->execute($maskedCartId); + $cart = $this->cartRepository->get($cartId); + $allErrors = []; +- if ($cart->getData('has_error')) { +- $errors = $cart->getErrors(); +- +- /** @var MessageInterface $error */ +- foreach ($errors as $error) { +- $allErrors[] = $this->error->create($error->getText()); +- } +- } + + $failedCartItems = $this->addItemsToCart($cart, $cartItems); + $saveCart = empty($failedCartItems); \ No newline at end of file diff --git a/docs/magento/patches/fix-custom-option-processing.patch b/docs/magento/patches/fix-custom-option-processing.patch new file mode 100644 index 0000000000..473c6cc07b --- /dev/null +++ b/docs/magento/patches/fix-custom-option-processing.patch @@ -0,0 +1,15 @@ +Fix custom options not saving on addProductsToCart. See https://github.com/magento/magento2/issues/37599 + +@package magento/module-quote + +--- a/Model/Quote.php ++++ b/Model/Quote.php +@@ -1647,6 +1647,8 @@ public function addProduct( + ); + } + ++ $productId = $product->getId(); ++ $product = clone $this->productRepository->getById($productId, false, $this->getStore()->getId()); + $cartCandidates = $product->getTypeInstance()->prepareForCartAdvanced($request, $product, $processMode); + + /** \ No newline at end of file