Skip to content

Commit

Permalink
1.0.23 Release (#44)
Browse files Browse the repository at this point in the history
* 1.0.23 Release

- Added patches

* 1.0.23 Release

- Added workaround for the composer-related issue with MDVA-33382 patch - composer/semver#126
- Removed MDVA-36754 patch - not a 'standalone' fix
- Resolved conflict between MDVA-30123 and MDVA-30186 patches
- Added patches descriptions

* 1.0.23 Release

- Resolved conflict between MDVA-30123 and MDVA-30186 patches

* 1.0.23 Release

- Resolved conflict between MDVA-36286 and MDVA-33453 patches
  • Loading branch information
agorbivskyi authored May 20, 2021
1 parent 4974f48 commit 301d10b
Show file tree
Hide file tree
Showing 18 changed files with 3,956 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/quality-patches",
"description": "Provides quality patches for Magento 2",
"type": "magento2-component",
"version": "1.0.22",
"version": "1.0.23",
"license": "proprietary",
"repositories": {
"repo": {
Expand Down
118 changes: 115 additions & 3 deletions patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,10 @@
"MDVA-33382": {
"magento/magento2-base": {
"Fixes the issues with indexers invalidation after products removal from a category.": {
"2.3.0 || >=2.3.4 <2.4.2": {
"2.3.0": {
"file": "os/MDVA-33382_2.3.5-p1.patch"
},
">=2.3.4 <2.4.2": {
"file": "os/MDVA-33382_2.3.5-p1.patch"
},
">=2.3.1 <2.3.4": {
Expand Down Expand Up @@ -1289,7 +1292,17 @@
"magento/inventory-composer-metapackage": {
"Fixes the issue where there is a fatal error in 'inventory:reservation:list-inconsistencies' because of wrong SKU parameter type.": {
">=1.1.4 <1.1.6": {
"file": "os/MDVA-33281_2.3.5-p1.patch"
"file": "os/MDVA-33281_1.1.5.patch"
},
"~1.1.6": {
"file": "os/MDVA-36844_1.1.6.patch"
}
}
},
"magento/inventory-metapackage": {
"Fixes the issue where there is a fatal error in 'inventory:reservation:list-inconsistencies' because of wrong SKU parameter type.": {
"~1.2.1": {
"file": "os/MDVA-37291_1.2.2.patch"
}
}
}
Expand Down Expand Up @@ -1978,6 +1991,9 @@
"Fixes the issue with missing bundled products on category pages.": {
">=2.3.4 <=2.3.4-p2": {
"file": "os/MDVA-34665_2.3.4-p2_v2.patch"
},
">=2.4.0 <2.4.3": {
"file": "os/MDVA-37350_2.4.1.patch"
}
}
},
Expand All @@ -1994,6 +2010,13 @@
"file": "commerce/MDVA-34665_1.1.4_v2.patch"
}
}
},
"magento/inventory-metapackage": {
"Fixes the issue with missing bundled products on category pages.": {
"^1.2.0": {
"file": "commerce/MDVA-37350_1.2.1.patch"
}
}
}
},
"MDVA-36615": {
Expand Down Expand Up @@ -2027,7 +2050,7 @@
"magento/module-page-builder": {
"Fixes the issue where media images, attached to page builder elements, disappear when the content is being edited repeatedly, if the backend base URL is different from the storefront base URL.": {
">=1.3.0 <=1.3.3-p1 || >=2.0.0 <2.2.0": {
"file": "commerce/MDVA-36424_2.3.6.patch"
"file": "commerce/MDVA-36424_1.3.3.patch"
}
}
}
Expand Down Expand Up @@ -2113,5 +2136,94 @@
}
}
}
},
"MDVA-37478": {
"magento/magento2-b2b-base": {
"Fixes the issue where Magento throws error when creating a partial invoice for order placed with payment method 'Payment on Account' through REST API.": {
"~1.1.1": {
"file": "commerce/MDVA-37478_1.1.3.patch"
}
}
}
},
"MDVA-37362": {
"magento/inventory-composer-metapackage": {
"Fixes the issue where configurable product option values and variant attribute values were empty in GraphQL response.": {
"^1.1.4": {
"file": "os/MDVA-37362_1.2.2.patch"
}
}
},
"magento/inventory-metapackage": {
"Fixes the issue where configurable product option values and variant attribute values were empty in GraphQL response.": {
"^1.2.0": {
"file": "os/MDVA-37362_1.2.2.patch"
}
}
}
},
"MDVA-37288": {
"magento/magento2-base": {
"Fixes the issue where wrong tier prices were returned after GraphQL request.": {
"2.4.2": {
"file": "os/MDVA-37288_2.4.2.patch"
}
}
}
},
"MDVA-37225": {
"magento/magento2-ee-base": {
"Fixes the issue where the upload process is stuck during quick order creation when there is an integer value in imported SKUs.": {
">=2.4.1 <2.4.3": {
"file": "commerce/MDVA-37225_2.4.1-p1.patch"
}
}
}
},
"MDVA-37224": {
"magento/magento2-base": {
"Fixes the issue where customers cannot pay for negotiable quote with PayFlow Pro, with another product in the cart.": {
">=2.3.3 <2.4.3": {
"file": "os/MDVA-37224_2.4.2.patch"
}
}
},
"magento/magento2-b2b-base": {
"Fixes the issue where customers cannot pay for negotiable quote with PayFlow Pro, with another product in the cart.": {
"^1.1.3": {
"file": "commerce/MDVA-37224_1.3.1.patch"
}
}
}
},
"MDVA-36286": {
"magento/module-page-builder": {
"Fixes the issue where Page Builder products widget preview breaks if the same SKU has a different position in subcategories.": {
"^1.3.3": {
"file": "commerce/MDVA-36286_1.3.3.patch",
"require": ["MDVA-33453"]
}
}
}
},
"MDVA-30186": {
"magento/magento2-base": {
"Fixes the issue where attribute options are sorted by option value instead of attribute item count, in GraphQL response.": {
">=2.3.4 <=2.3.5-p2 || >=2.4.0 <=2.4.0-p1": {
"file": "os/MDVA-30186_2.3.4.patch",
"require": ["MDVA-30123"]
},
">=2.4.2 <2.4.3": {
"file": "os/MDVA-37246_2.4.2.patch"
}
}
},
"magento/magento2-ee-base": {
"Fixes the issue where attribute options are sorted by option value instead of attribute item count, in GraphQL response.": {
">=2.3.4 <=2.3.5-p2 || >=2.4.0 <=2.4.0-p1": {
"file": "commerce/MDVA-30186_2.3.4.patch"
}
}
}
}
}
122 changes: 122 additions & 0 deletions patches/commerce/MDVA-30186_2.3.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
diff --git a/vendor/magento/module-visual-merchandiser/Plugin/Catalog/Model/ResourceModel/Product/RankCategoryProductPositions.php b/vendor/magento/module-visual-merchandiser/Plugin/Catalog/Model/ResourceModel/Product/RankCategoryProductPositions.php
new file mode 100644
index 00000000000..20a862a347b
--- /dev/null
+++ b/vendor/magento/module-visual-merchandiser/Plugin/Catalog/Model/ResourceModel/Product/RankCategoryProductPositions.php
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+declare(strict_types=1);
+
+namespace Magento\VisualMerchandiser\Plugin\Catalog\Model\ResourceModel\Product;
+
+use Magento\Catalog\Api\Data\ProductInterface;
+use Magento\Catalog\Model\ResourceModel\Category as CategoryResourceModel;
+use Magento\Catalog\Model\ResourceModel\Product\CategoryLink as CategoryProductLink;
+use Magento\Catalog\Model\Category\Product\PositionResolver as CategoryProductPositionResolver;
+use Magento\Framework\App\ResourceConnection;
+
+/**
+ * Rank category product positions on product save.
+ */
+class RankCategoryProductPositions
+{
+ /**
+ * @var CategoryResourceModel
+ */
+ private $categoryResourceModel;
+
+ /**
+ * @var CategoryProductPositionResolver
+ */
+ private $positionResolver;
+
+ /**
+ * @var ResourceConnection
+ */
+ private $resourceConnection;
+
+ /**
+ * @param CategoryResourceModel $categoryResourceModel
+ * @param CategoryProductPositionResolver $positionResolver
+ * @param ResourceConnection $resourceConnection
+ */
+ public function __construct(
+ CategoryResourceModel $categoryResourceModel,
+ CategoryProductPositionResolver $positionResolver,
+ ResourceConnection $resourceConnection
+ ) {
+ $this->categoryResourceModel = $categoryResourceModel;
+ $this->positionResolver = $positionResolver;
+ $this->resourceConnection = $resourceConnection;
+ }
+
+ /**
+ * Rank category product positions.
+ *
+ * @param CategoryProductLink $categoryProductLink
+ * @param callable $proceed
+ * @param ProductInterface $product
+ * @param array $insertLinks
+ * @param bool $insert
+ * @return array
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function aroundUpdateCategoryLinks(
+ CategoryProductLink $categoryProductLink,
+ callable $proceed,
+ ProductInterface $product,
+ array $insertLinks,
+ $insert = false
+ ): array {
+ foreach ($insertLinks as $link) {
+ $this->resourceConnection->getConnection()->insertOnDuplicate(
+ $this->categoryResourceModel->getCategoryProductTable(),
+ $this->getCategoryProductPositions((int) $product->getId(), (int) $link['category_id']),
+ ['position']
+ );
+ }
+
+ return array_column($insertLinks, 'category_id');
+ }
+
+ /**
+ * Retrieve and prepare category product positions array.
+ *
+ * @param int $productId
+ * @param int $categoryId
+ * @return array
+ */
+ private function getCategoryProductPositions(int $productId, int $categoryId): array
+ {
+ $categoryProductPositions = [];
+ $existingCategoryProductPositions = array_flip($this->positionResolver->getPositions((int) $categoryId));
+ array_unshift($existingCategoryProductPositions, $productId);
+
+ foreach (array_flip($existingCategoryProductPositions) as $productId => $productPosition) {
+ $categoryProductPositions[] = [
+ 'category_id' => (int) $categoryId,
+ 'product_id' => $productId,
+ 'position' => $productPosition,
+ ];
+ }
+
+ return $categoryProductPositions;
+ }
+}
diff --git a/vendor/magento/module-visual-merchandiser/etc/adminhtml/di.xml b/vendor/magento/module-visual-merchandiser/etc/adminhtml/di.xml
index 9b581da080b..cdbafab69c4 100644
--- a/vendor/magento/module-visual-merchandiser/etc/adminhtml/di.xml
+++ b/vendor/magento/module-visual-merchandiser/etc/adminhtml/di.xml
@@ -15,4 +15,7 @@
<type name="Magento\Catalog\Controller\Adminhtml\Category\Save">
<plugin name="adminhtmlCategorySavePlugin" type="Magento\VisualMerchandiser\Plugin\Catalog\Controller\Adminhtml\Category\SavePlugin" />
</type>
+ <type name="Magento\Catalog\Model\ResourceModel\Product\CategoryLink">
+ <plugin name="adminhtmlRankCategoryProductPositionsPlugin" type="Magento\VisualMerchandiser\Plugin\Catalog\Model\ResourceModel\Product\RankCategoryProductPositions" />
+ </type>
</config>
Loading

0 comments on commit 301d10b

Please sign in to comment.