Skip to content

Commit

Permalink
1.0.24 Release (#45)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
agorbivskyi authored Jun 2, 2021
1 parent 301d10b commit 056a8af
Show file tree
Hide file tree
Showing 8 changed files with 362 additions and 2 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.23",
"version": "1.0.24",
"license": "proprietary",
"repositories": {
"repo": {
Expand Down
50 changes: 49 additions & 1 deletion patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down Expand Up @@ -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"
}
}
}
}
}
13 changes: 13 additions & 0 deletions patches/commerce/MDVA-36832_1.3.2.patch
Original file line number Diff line number Diff line change
@@ -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;
}
74 changes: 74 additions & 0 deletions patches/os/MDVA-34330_2.4.1.patch
Original file line number Diff line number Diff line change
@@ -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);
+ }
}
18 changes: 18 additions & 0 deletions patches/os/MDVA-37751_2.4.1.patch
Original file line number Diff line number Diff line change
@@ -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);

13 changes: 13 additions & 0 deletions patches/os/MDVA-37779_2.4.2_v2.patch
Original file line number Diff line number Diff line change
@@ -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)) {
24 changes: 24 additions & 0 deletions patches/os/MDVA-37874_2.4.2.patch
Original file line number Diff line number Diff line change
@@ -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 ?
170 changes: 170 additions & 0 deletions patches/os/MDVA-37913_2.3.6.patch
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 056a8af

Please sign in to comment.