diff --git a/Patch-Magento_RelatedProductGraphQl-M2.4.0-2.4.1-remove-related-products-not-in-maplist.patch b/Patch-Magento_RelatedProductGraphQl-M2.4.0-2.4.1-remove-related-products-not-in-maplist.patch new file mode 100644 index 0000000..85f17e1 --- /dev/null +++ b/Patch-Magento_RelatedProductGraphQl-M2.4.0-2.4.1-remove-related-products-not-in-maplist.patch @@ -0,0 +1,13 @@ +--- Model/Resolver/Batch/AbstractLikedProducts.php 2020-07-20 11:13:10.000000000 +0000 ++++ Model/Resolver/Batch/AbstractLikedProducts.php 2021-03-03 13:55:38.897669052 +0000 +@@ -110,6 +110,10 @@ + //Matching products with related products. + $relationsData = []; + foreach ($relations as $productId => $relatedIds) { ++ //Remove related products that not exist in map list. ++ $relatedIds = array_filter($relatedIds, function ($relatedId) use ($relatedProducts) { ++ return isset($relatedProducts[$relatedId]); ++ }); + $relationsData[$productId] = array_map( + function ($id) use ($relatedProducts) { + return $relatedProducts[$id]; diff --git a/README.md b/README.md index a81db6d..c305be9 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ magento/module-elasticsearch|Patch-Magento\_Elasticsearch-M2.3.x-Send-Error-Mess magento/module-elasticsearch|Patch-Magento\_Elasticsearch-M2.3.0-M2.3.1-prices-pass-website-id.patch| | >= 2.3.0 <= 2.3.1 magento/module-elasticsearch|Patch-Magento_Elasticsearch-M2.3-attribute-options-optimization.patch|Attribute Options Optimization|\>= 2.3.0 magento/module-indexer|Patch-Magento_Indexer-M2.3.1-indexer-reindex-optional-dependencies.patch|indexer:reindex command - Optional dependencies|\>= 2.3.1 +magento/module-related-product-graph-ql|Patch-Magento_RelatedProductGraphQl-M2.4.0-2.4.1-remove-related-products-not-in-maplist|#28892| >= 2.4.0 <= 2.4.2 magento/module-review|Patch-Magento\_Review-M2.2-review-renderer-module-namespace.patch| |all as of 2.2.5 magento/module-review|Patch-Magento_Review-M2.3-observer-catalog-check-is-active.patch|Fix: Product Collection Observer - Check module status| magento/module-theme|Patch-Magento\_Email-M2.1.0-create-email-logo-2.patch| |< 2.1.8 (2.1.4 n/a) diff --git a/patches.json b/patches.json index a37301e..249bb98 100644 --- a/patches.json +++ b/patches.json @@ -376,6 +376,12 @@ "version": "*" } }, + "magento/module-related-product-graph-ql": { + "Fix: https://github.com/magento/magento2/issues/28892": { + "file": "Patch-Magento_RelatedProductGraphQl-M2.4.0-2.4.1-remove-related-products-not-in-maplist.patch", + "version": "*" + } + }, "magento/module-review": { "Fix review namespace": { "file": "Patch-Magento_Review-M2.2-review-renderer-module-namespace.patch",