From 056a8af7aba8b9f73c8a1dbfa3414e6d509bce82 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorbivskyi Date: Wed, 2 Jun 2021 12:12:36 -0700 Subject: [PATCH] 1.0.24 Release (#45) * 1.0.24 Release - Added patches * 1.0.24 Release - Removed MDVA-28183 patch * 1.0.24 Release - Added patches descriptions - Added missed MDVA-37779 patch --- composer.json | 2 +- patches.json | 50 ++++++- patches/commerce/MDVA-36832_1.3.2.patch | 13 ++ patches/os/MDVA-34330_2.4.1.patch | 74 +++++++++++ patches/os/MDVA-37751_2.4.1.patch | 18 +++ patches/os/MDVA-37779_2.4.2_v2.patch | 13 ++ patches/os/MDVA-37874_2.4.2.patch | 24 ++++ patches/os/MDVA-37913_2.3.6.patch | 170 ++++++++++++++++++++++++ 8 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 patches/commerce/MDVA-36832_1.3.2.patch create mode 100644 patches/os/MDVA-34330_2.4.1.patch create mode 100644 patches/os/MDVA-37751_2.4.1.patch create mode 100644 patches/os/MDVA-37779_2.4.2_v2.patch create mode 100644 patches/os/MDVA-37874_2.4.2.patch create mode 100644 patches/os/MDVA-37913_2.3.6.patch diff --git a/composer.json b/composer.json index 1df98133..54465842 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/quality-patches", "description": "Provides quality patches for Magento 2", "type": "magento2-component", - "version": "1.0.23", + "version": "1.0.24", "license": "proprietary", "repositories": { "repo": { diff --git a/patches.json b/patches.json index c97425f1..03e87b68 100644 --- a/patches.json +++ b/patches.json @@ -607,8 +607,11 @@ "file": "os/MDVA-25028_2.3.2.patch", "require": ["MDVA-31006"] }, - ">=2.3.5 <2.3.6": { + ">=2.3.5 <=2.3.5-p2": { "file": "os/MDVA-31282_2.3.5-p2.patch" + }, + ">=2.3.6 <=2.4.2-p1": { + "file": "os/MDVA-37751_2.4.1.patch" } } } @@ -2225,5 +2228,50 @@ } } } + }, + "MDVA-37779": { + "magento/magento2-base": { + "Fixes the issue with adding a configurable product to cart via GraphQL when website ID does not coincide with store ID.": { + ">=2.4.2 <2.4.4": { + "file": "os/MDVA-37779_2.4.2_v2.patch" + } + } + } + }, + "MDVA-36832": { + "magento/module-page-builder": { + "Fixes the issue where images duplicate on pages when view width is 768px.": { + "^1.2.0": { + "file": "commerce/MDVA-36832_1.3.2.patch" + } + } + } + }, + "MDVA-37874": { + "magento/magento2-base": { + "Fixes the issue where 'Fixed discount amount for whole cart' is incorrectly applied to a bundle product containing more than one option.": { + ">=2.3.6 <=2.3.7 || >=2.4.1 <2.4.3": { + "file": "os/MDVA-37874_2.4.2.patch" + } + } + } + }, + "MDVA-37913": { + "magento/magento2-base": { + "Fixes the issue where downloadable links disappear if the downloadable product gets updated via API.": { + ">=2.3.0 <=2.4.0-p1": { + "file": "os/MDVA-37913_2.3.6.patch" + } + } + } + }, + "MDVA-34330": { + "magento/magento2-base": { + "Fixes the issue where orders in the Orders grid are not filtered according to admin timezone.": { + ">=2.3.1 <2.4.3": { + "file": "os/MDVA-34330_2.4.1.patch" + } + } + } } } diff --git a/patches/commerce/MDVA-36832_1.3.2.patch b/patches/commerce/MDVA-36832_1.3.2.patch new file mode 100644 index 00000000..c08b909d --- /dev/null +++ b/patches/commerce/MDVA-36832_1.3.2.patch @@ -0,0 +1,13 @@ +diff --git a/vendor/magento/module-page-builder/view/frontend/web/css/source/_module.less b/vendor/magento/module-page-builder/view/frontend/web/css/source/_module.less +index 479369d52..75d7b7f0f 100644 +--- a/vendor/magento/module-page-builder/view/frontend/web/css/source/_module.less ++++ b/vendor/magento/module-page-builder/view/frontend/web/css/source/_module.less +@@ -67,7 +67,7 @@ + // Desktop (style-l.css) + // _____________________________________________ + +-.media-width(@extremum, @break) when (@extremum = 'min') and (@break = (@screen__m + 1)) { ++.media-width(@extremum, @break) when (@extremum = 'min') and (@break = (@screen__m)) { + .pagebuilder-mobile-only { + display: none !important; + } diff --git a/patches/os/MDVA-34330_2.4.1.patch b/patches/os/MDVA-34330_2.4.1.patch new file mode 100644 index 00000000..634fc73c --- /dev/null +++ b/patches/os/MDVA-34330_2.4.1.patch @@ -0,0 +1,74 @@ +diff --git a/vendor/magento/module-sales/Model/ResourceModel/Order/Grid/Collection.php b/vendor/magento/module-sales/Model/ResourceModel/Order/Grid/Collection.php +index 82c612c1a78..74cf85da6cc 100644 +--- a/vendor/magento/module-sales/Model/ResourceModel/Order/Grid/Collection.php ++++ b/vendor/magento/module-sales/Model/ResourceModel/Order/Grid/Collection.php +@@ -5,16 +5,25 @@ + */ + namespace Magento\Sales\Model\ResourceModel\Order\Grid; + ++use Magento\Framework\App\ObjectManager; + use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy; + use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory; + use Magento\Framework\Event\ManagerInterface as EventManager; ++use Magento\Framework\Stdlib\DateTime\TimezoneInterface; ++use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult; ++use Magento\Sales\Model\ResourceModel\Order; + use Psr\Log\LoggerInterface as Logger; + + /** + * Order grid collection + */ +-class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult ++class Collection extends SearchResult + { ++ /** ++ * @var TimezoneInterface ++ */ ++ private $timeZone; ++ + /** + * Initialize dependencies. + * +@@ -24,6 +33,7 @@ class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvide + * @param EventManager $eventManager + * @param string $mainTable + * @param string $resourceModel ++ * @param TimezoneInterface|null $timeZone + */ + public function __construct( + EntityFactory $entityFactory, +@@ -31,9 +41,12 @@ class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvide + FetchStrategy $fetchStrategy, + EventManager $eventManager, + $mainTable = 'sales_order_grid', +- $resourceModel = \Magento\Sales\Model\ResourceModel\Order::class ++ $resourceModel = Order::class, ++ TimezoneInterface $timeZone = null + ) { + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel); ++ $this->timeZone = $timeZone ?: ObjectManager::getInstance() ++ ->get(TimezoneInterface::class); + } + + /** +@@ -50,4 +63,20 @@ class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvide + + return $this; + } ++ ++ /** ++ * @inheritDoc ++ */ ++ public function addFieldToFilter($field, $condition = null) ++ { ++ if ($field === 'created_at') { ++ if (is_array($condition)) { ++ foreach ($condition as $key => $value) { ++ $condition[$key] = $this->timeZone->convertConfigTimeToUtc($value); ++ } ++ } ++ } ++ ++ return parent::addFieldToFilter($field, $condition); ++ } + } diff --git a/patches/os/MDVA-37751_2.4.1.patch b/patches/os/MDVA-37751_2.4.1.patch new file mode 100644 index 00000000..81f0a4a6 --- /dev/null +++ b/patches/os/MDVA-37751_2.4.1.patch @@ -0,0 +1,18 @@ +diff --git a/vendor/magento/module-paypal/Model/Payflow/Transparent.php b/vendor/magento/module-paypal/Model/Payflow/Transparent.php +index 87cb0df7b0d..19e2886a9f7 100644 +--- a/vendor/magento/module-paypal/Model/Payflow/Transparent.php ++++ b/vendor/magento/module-paypal/Model/Payflow/Transparent.php +@@ -331,11 +331,9 @@ class Transparent extends Payflowpro implements TransparentInterface + $zeroAmountAuthorizationId = $this->getZeroAmountAuthorizationId($payment); + /** @var PaymentTokenInterface $vaultPaymentToken */ + $vaultPaymentToken = $payment->getExtensionAttributes()->getVaultPaymentToken(); +- if ($vaultPaymentToken && empty($zeroAmountAuthorizationId)) { ++ if ($vaultPaymentToken && empty($zeroAmountAuthorizationId) && empty($payment->getParentTransactionId())) { + $payment->setAdditionalInformation(self::PNREF, $vaultPaymentToken->getGatewayToken()); +- if (!$payment->getParentTransactionId()) { +- $payment->setParentTransactionId($vaultPaymentToken->getGatewayToken()); +- } ++ $payment->setParentTransactionId($vaultPaymentToken->getGatewayToken()); + } + parent::capture($payment, $amount); + diff --git a/patches/os/MDVA-37779_2.4.2_v2.patch b/patches/os/MDVA-37779_2.4.2_v2.patch new file mode 100644 index 00000000..2b968d31 --- /dev/null +++ b/patches/os/MDVA-37779_2.4.2_v2.patch @@ -0,0 +1,13 @@ +diff --git a/vendor/magento/module-configurable-product-graph-ql/Model/Cart/BuyRequest/SuperAttributeDataProvider.php b/vendor/magento/module-configurable-product-graph-ql/Model/Cart/BuyRequest/SuperAttributeDataProvider.php +index 0fa4b8da508..4877450b171 100644 +--- a/vendor/magento/module-configurable-product-graph-ql/Model/Cart/BuyRequest/SuperAttributeDataProvider.php ++++ b/vendor/magento/module-configurable-product-graph-ql/Model/Cart/BuyRequest/SuperAttributeDataProvider.php +@@ -93,7 +93,7 @@ class SuperAttributeDataProvider implements BuyRequestDataProviderInterface + throw new GraphQlNoSuchEntityException(__('Could not find specified product.')); + } + +- $this->checkProductStock($sku, (float) $qty, (int) $cart->getStoreId()); ++ $this->checkProductStock($sku, (float) $qty, (int) $cart->getStore()->getWebsiteId()); + + $configurableProductLinks = $parentProduct->getExtensionAttributes()->getConfigurableProductLinks(); + if (!in_array($product->getId(), $configurableProductLinks)) { diff --git a/patches/os/MDVA-37874_2.4.2.patch b/patches/os/MDVA-37874_2.4.2.patch new file mode 100644 index 00000000..d5da1520 --- /dev/null +++ b/patches/os/MDVA-37874_2.4.2.patch @@ -0,0 +1,24 @@ +diff --git a/vendor/magento/module-sales-rule/Model/Rule/Action/Discount/CartFixed.php b/vendor/magento/module-sales-rule/Model/Rule/Action/Discount/CartFixed.php +index 1569c9551aa..0adeedc32f7 100644 +--- a/vendor/magento/module-sales-rule/Model/Rule/Action/Discount/CartFixed.php ++++ b/vendor/magento/module-sales-rule/Model/Rule/Action/Discount/CartFixed.php +@@ -111,7 +111,7 @@ class CartFixed extends AbstractDiscount + $address, + $baseRuleTotals + ) : $baseRuleTotals; +- $availableDiscountAmount = $this->cartFixedDiscountHelper ++ $maximumItemDiscount = $this->cartFixedDiscountHelper + ->getDiscountAmount( + $ruleDiscount, + $qty, +@@ -119,8 +119,8 @@ class CartFixed extends AbstractDiscount + $baseRuleTotals, + $discountType + ); +- $quoteAmount = $this->priceCurrency->convert($availableDiscountAmount, $store); +- $baseDiscountAmount = min($baseItemPrice * $qty, $availableDiscountAmount); ++ $quoteAmount = $this->priceCurrency->convert($maximumItemDiscount, $store); ++ $baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount); + $this->deltaPriceRound->reset($discountType); + } else { + $baseRuleTotals = $shippingMethod ? diff --git a/patches/os/MDVA-37913_2.3.6.patch b/patches/os/MDVA-37913_2.3.6.patch new file mode 100644 index 00000000..e6edc906 --- /dev/null +++ b/patches/os/MDVA-37913_2.3.6.patch @@ -0,0 +1,170 @@ +diff --git a/vendor/magento/module-downloadable/Model/Link/UpdateHandler.php b/vendor/magento/module-downloadable/Model/Link/UpdateHandler.php +index 8e351b3dfb0..3e7095825a3 100644 +--- a/vendor/magento/module-downloadable/Model/Link/UpdateHandler.php ++++ b/vendor/magento/module-downloadable/Model/Link/UpdateHandler.php +@@ -5,15 +5,18 @@ + */ + namespace Magento\Downloadable\Model\Link; + ++use Magento\Catalog\Api\Data\ProductInterface; + use Magento\Downloadable\Api\LinkRepositoryInterface as LinkRepository; + use Magento\Downloadable\Model\Product\Type; + use Magento\Framework\EntityManager\Operation\ExtensionInterface; + + /** +- * Class UpdateHandler ++ * UpdateHandler for downloadable product links + */ + class UpdateHandler implements ExtensionInterface + { ++ private const GLOBAL_SCOPE_ID = 0; ++ + /** + * @var LinkRepository + */ +@@ -28,35 +31,48 @@ class UpdateHandler implements ExtensionInterface + } + + /** ++ * Update links for downloadable product if exist ++ * + * @param object $entity + * @param array $arguments +- * @return \Magento\Catalog\Api\Data\ProductInterface|object +- * @SuppressWarnings(PHPMD.UnusedFormalParameter) ++ * @return ProductInterface|object + */ + public function execute($entity, $arguments = []) + { +- /** @var $entity \Magento\Catalog\Api\Data\ProductInterface */ +- if ($entity->getTypeId() != Type::TYPE_DOWNLOADABLE) { +- return $entity; ++ $links = $entity->getExtensionAttributes()->getDownloadableProductLinks(); ++ ++ /** @var $entity ProductInterface */ ++ if ($links && $entity->getTypeId() === Type::TYPE_DOWNLOADABLE) { ++ $this->updateLinks($entity, $links); + } + +- /** @var \Magento\Downloadable\Api\Data\LinkInterface[] $links */ +- $links = $entity->getExtensionAttributes()->getDownloadableProductLinks() ?: []; +- $updatedLinks = []; ++ return $entity; ++ } ++ ++ /** ++ * Update product links ++ * ++ * @param ProductInterface $entity ++ * @param array $links ++ * @return void ++ */ ++ private function updateLinks(ProductInterface $entity, array $links): void ++ { ++ $isGlobalScope = (int) $entity->getStoreId() === self::GLOBAL_SCOPE_ID; + $oldLinks = $this->linkRepository->getList($entity->getSku()); ++ ++ $updatedLinks = []; + foreach ($links as $link) { + if ($link->getId()) { + $updatedLinks[$link->getId()] = true; + } +- $this->linkRepository->save($entity->getSku(), $link, !(bool)$entity->getStoreId()); ++ $this->linkRepository->save($entity->getSku(), $link, $isGlobalScope); + } +- /** @var \Magento\Catalog\Api\Data\ProductInterface $entity */ ++ + foreach ($oldLinks as $link) { + if (!isset($updatedLinks[$link->getId()])) { + $this->linkRepository->delete($link->getId()); + } + } +- +- return $entity; + } + } +diff --git a/vendor/magento/module-downloadable/Model/Sample/UpdateHandler.php b/vendor/magento/module-downloadable/Model/Sample/UpdateHandler.php +index 80294032aea..5def2daa230 100644 +--- a/vendor/magento/module-downloadable/Model/Sample/UpdateHandler.php ++++ b/vendor/magento/module-downloadable/Model/Sample/UpdateHandler.php +@@ -5,15 +5,18 @@ + */ + namespace Magento\Downloadable\Model\Sample; + ++use Magento\Catalog\Api\Data\ProductInterface; + use Magento\Downloadable\Api\SampleRepositoryInterface as SampleRepository; + use Magento\Downloadable\Model\Product\Type; + use Magento\Framework\EntityManager\Operation\ExtensionInterface; + + /** +- * Class UpdateHandler ++ * UpdateHandler for downloadable product samples + */ + class UpdateHandler implements ExtensionInterface + { ++ private const GLOBAL_SCOPE_ID = 0; ++ + /** + * @var SampleRepository + */ +@@ -28,35 +31,48 @@ class UpdateHandler implements ExtensionInterface + } + + /** ++ * Update samples for downloadable product if exist ++ * + * @param object $entity + * @param array $arguments +- * @return \Magento\Catalog\Api\Data\ProductInterface|object +- * @SuppressWarnings(PHPMD.UnusedFormalParameter) ++ * @return ProductInterface|object + */ + public function execute($entity, $arguments = []) + { +- /** @var $entity \Magento\Catalog\Api\Data\ProductInterface */ +- if ($entity->getTypeId() != Type::TYPE_DOWNLOADABLE) { +- return $entity; ++ $samples = $entity->getExtensionAttributes()->getDownloadableProductSamples(); ++ ++ /** @var $entity ProductInterface */ ++ if ($samples && $entity->getTypeId() === Type::TYPE_DOWNLOADABLE) { ++ $this->updateSamples($entity, $samples); + } + +- /** @var \Magento\Downloadable\Api\Data\SampleInterface[] $samples */ +- $samples = $entity->getExtensionAttributes()->getDownloadableProductSamples() ?: []; +- $updatedSamples = []; ++ return $entity; ++ } ++ ++ /** ++ * Update product samples ++ * ++ * @param ProductInterface $entity ++ * @param array $samples ++ * @return void ++ */ ++ private function updateSamples(ProductInterface $entity, array $samples): void ++ { ++ $isGlobalScope = (int) $entity->getStoreId() === self::GLOBAL_SCOPE_ID; + $oldSamples = $this->sampleRepository->getList($entity->getSku()); ++ ++ $updatedSamples = []; + foreach ($samples as $sample) { + if ($sample->getId()) { + $updatedSamples[$sample->getId()] = true; + } +- $this->sampleRepository->save($entity->getSku(), $sample, !(bool)$entity->getStoreId()); ++ $this->sampleRepository->save($entity->getSku(), $sample, $isGlobalScope); + } +- /** @var \Magento\Catalog\Api\Data\ProductInterface $entity */ ++ + foreach ($oldSamples as $sample) { + if (!isset($updatedSamples[$sample->getId()])) { + $this->sampleRepository->delete($sample->getId()); + } + } +- +- return $entity; + } + }