From fe678cf88f1123c24349cb01044bd408fdfa7f6f Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Fri, 18 Dec 2020 23:01:19 +0100 Subject: [PATCH 01/26] REFACTOR: Remove misleading aliases, refactor --- app/code/Magento/Swatches/Helper/Data.php | 75 +++++++++++------------ 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/app/code/Magento/Swatches/Helper/Data.php b/app/code/Magento/Swatches/Helper/Data.php index dd257de331b91..f122a02c70f86 100644 --- a/app/code/Magento/Swatches/Helper/Data.php +++ b/app/code/Magento/Swatches/Helper/Data.php @@ -6,9 +6,9 @@ namespace Magento\Swatches\Helper; use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface; -use Magento\Catalog\Api\Data\ProductInterface as Product; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Product as ModelProduct; +use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Image\UrlBuilder; use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection; @@ -23,8 +23,6 @@ use Magento\Swatches\Model\SwatchAttributeType; /** - * Class Helper Data - * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Data @@ -83,8 +81,11 @@ class Data ]; /** - * Serializer to/from JSON. - * + * @var array + */ + private $swatchesCache = []; + + /** * @var Json */ private $serializer; @@ -106,7 +107,7 @@ class Data * @param SwatchCollectionFactory $swatchCollectionFactory * @param UrlBuilder $urlBuilder * @param Json|null $serializer - * @param SwatchAttributesProvider $swatchAttributesProvider + * @param SwatchAttributesProvider|null $swatchAttributesProvider * @param SwatchAttributeType|null $swatchTypeChecker */ public function __construct( @@ -123,12 +124,12 @@ public function __construct( $this->productRepository = $productRepository; $this->storeManager = $storeManager; $this->swatchCollectionFactory = $swatchCollectionFactory; + $this->imageUrlBuilder = $urlBuilder; $this->serializer = $serializer ?: ObjectManager::getInstance()->create(Json::class); $this->swatchAttributesProvider = $swatchAttributesProvider ?: ObjectManager::getInstance()->get(SwatchAttributesProvider::class); $this->swatchTypeChecker = $swatchTypeChecker ?: ObjectManager::getInstance()->create(SwatchAttributeType::class); - $this->imageUrlBuilder = $urlBuilder; } /** @@ -163,11 +164,11 @@ public function assembleAdditionalDataEavAttribute(Attribute $attribute) /** * Check is media attribute available * - * @param ModelProduct $product + * @param Product $product * @param string $attributeCode * @return bool */ - private function isMediaAvailable(ModelProduct $product, string $attributeCode): bool + private function isMediaAvailable(Product $product, string $attributeCode): bool { $isAvailable = false; @@ -186,11 +187,11 @@ private function isMediaAvailable(ModelProduct $product, string $attributeCode): * Load first variation * * @param string $attributeCode swatch_image|image - * @param ModelProduct $configurableProduct + * @param Product $configurableProduct * @param array $requiredAttributes - * @return bool|Product + * @return bool|ProductInterface */ - private function loadFirstVariation($attributeCode, ModelProduct $configurableProduct, array $requiredAttributes) + private function loadFirstVariation($attributeCode, Product $configurableProduct, array $requiredAttributes) { if ($this->isProductHasSwatch($configurableProduct)) { $usedProducts = $configurableProduct->getTypeInstance()->getUsedProducts($configurableProduct); @@ -210,11 +211,11 @@ private function loadFirstVariation($attributeCode, ModelProduct $configurablePr /** * Load first variation with swatch image * - * @param Product $configurableProduct + * @param ProductInterface|Product $configurableProduct * @param array $requiredAttributes - * @return bool|Product + * @return bool|ProductInterface */ - public function loadFirstVariationWithSwatchImage(Product $configurableProduct, array $requiredAttributes) + public function loadFirstVariationWithSwatchImage(ProductInterface $configurableProduct, array $requiredAttributes) { return $this->loadFirstVariation('swatch_image', $configurableProduct, $requiredAttributes); } @@ -222,11 +223,11 @@ public function loadFirstVariationWithSwatchImage(Product $configurableProduct, /** * Load first variation with image * - * @param Product $configurableProduct + * @param ProductInterface|Product $configurableProduct * @param array $requiredAttributes - * @return bool|Product + * @return bool|ProductInterface */ - public function loadFirstVariationWithImage(Product $configurableProduct, array $requiredAttributes) + public function loadFirstVariationWithImage(ProductInterface $configurableProduct, array $requiredAttributes) { return $this->loadFirstVariation('image', $configurableProduct, $requiredAttributes); } @@ -234,11 +235,11 @@ public function loadFirstVariationWithImage(Product $configurableProduct, array /** * Load Variation Product using fallback * - * @param Product $parentProduct + * @param ProductInterface $parentProduct * @param array $attributes - * @return bool|Product + * @return bool|ProductInterface */ - public function loadVariationByFallback(Product $parentProduct, array $attributes) + public function loadVariationByFallback(ProductInterface $parentProduct, array $attributes) { if (!$this->isProductHasSwatch($parentProduct)) { return false; @@ -318,12 +319,12 @@ private function addFilterByParent(ProductCollection $productCollection, $parent * ] * ] * - * @param ModelProduct $product + * @param Product $product * * @return array * @throws \Magento\Framework\Exception\LocalizedException */ - public function getProductMediaGallery(ModelProduct $product): array + public function getProductMediaGallery(Product $product): array { $baseImage = null; $gallery = []; @@ -394,22 +395,21 @@ private function getAllSizeImages($imageFile) /** * Retrieve collection of Swatch attributes * - * @param Product $product + * @param ProductInterface|Product $product * @return \Magento\Catalog\Model\ResourceModel\Eav\Attribute[] */ - private function getSwatchAttributes(Product $product) + private function getSwatchAttributes(ProductInterface $product) { - $swatchAttributes = $this->swatchAttributesProvider->provide($product); - return $swatchAttributes; + return $this->swatchAttributesProvider->provide($product); } /** * Retrieve collection of Eav Attributes from Configurable product * - * @param Product $product + * @param ProductInterface|Product $product * @return \Magento\Catalog\Model\ResourceModel\Eav\Attribute[] */ - public function getAttributesFromConfigurable(Product $product) + public function getAttributesFromConfigurable(ProductInterface $product) { $result = []; $typeInstance = $product->getTypeInstance(); @@ -428,10 +428,10 @@ public function getAttributesFromConfigurable(Product $product) /** * Retrieve all visible Swatch attributes for current product. * - * @param Product $product + * @param ProductInterface $product * @return array */ - public function getSwatchAttributesAsArray(Product $product) + public function getSwatchAttributesAsArray(ProductInterface $product) { $result = []; $swatchAttributes = $this->getSwatchAttributes($product); @@ -447,11 +447,6 @@ public function getSwatchAttributesAsArray(Product $product) return $result; } - /** - * @var array - */ - private $swatchesCache = []; - /** * Get swatch options by option id's according to fallback logic * @@ -511,7 +506,7 @@ private function getCachedSwatches(array $optionIds) private function setCachedSwatches(array $optionIds, array $swatches) { foreach ($optionIds as $optionId) { - $this->swatchesCache[$optionId] = isset($swatches[$optionId]) ? $swatches[$optionId] : null; + $this->swatchesCache[$optionId] = $swatches[$optionId] ?? null; } } @@ -543,10 +538,10 @@ private function addFallbackOptions(array $fallbackValues, array $swatches) /** * Check if the Product has Swatch attributes * - * @param Product $product + * @param ProductInterface $product * @return bool */ - public function isProductHasSwatch(Product $product) + public function isProductHasSwatch(ProductInterface $product) { return !empty($this->getSwatchAttributes($product)); } From 0ad8dc2d833a3d6e563f98abe3600e9476c5ff15 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Sat, 19 Dec 2020 00:21:15 +0100 Subject: [PATCH 02/26] Refactor: PriceBackend plugin --- .../Model/Plugin/PriceBackend.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php b/app/code/Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php index da9f1316c6bd7..a20212c74fbe7 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php +++ b/app/code/Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php @@ -3,14 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ConfigurableProduct\Model\Plugin; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; /** - * Class PriceBackend - * - * Make price validation optional for configurable product + * Make price validation optional for configurable product */ class PriceBackend { @@ -26,12 +27,10 @@ public function aroundValidate( \Closure $proceed, $object ) { - if ($object instanceof \Magento\Catalog\Model\Product - && $object->getTypeId() == Configurable::TYPE_CODE - ) { + if ($object instanceof ProductInterface && $object->getTypeId() === Configurable::TYPE_CODE) { return true; - } else { - return $proceed($object); } + + return $proceed($object); } } From 3ee2bd5b61838b7c64077739278d8fcf9807d698 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Sat, 19 Dec 2020 00:22:29 +0100 Subject: [PATCH 03/26] Refactor: SecurityInfo plugin --- app/code/Magento/Store/Url/Plugin/SecurityInfo.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Store/Url/Plugin/SecurityInfo.php b/app/code/Magento/Store/Url/Plugin/SecurityInfo.php index bfca3e7341ef2..0de02564c83a4 100644 --- a/app/code/Magento/Store/Url/Plugin/SecurityInfo.php +++ b/app/code/Magento/Store/Url/Plugin/SecurityInfo.php @@ -3,10 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Store\Url\Plugin; -use \Magento\Store\Model\Store; -use \Magento\Store\Model\ScopeInterface as StoreScopeInterface; +use Magento\Store\Model\ScopeInterface as StoreScopeInterface; +use Magento\Store\Model\Store; /** * Plugin for \Magento\Framework\Url\SecurityInfo @@ -39,8 +41,8 @@ public function aroundIsSecure(\Magento\Framework\Url\SecurityInfo $subject, \Cl { if ($this->scopeConfig->getValue(Store::XML_PATH_SECURE_IN_FRONTEND, StoreScopeInterface::SCOPE_STORE)) { return $proceed($url); - } else { - return false; } + + return false; } } From b979e0a7b7c2317262bdb23ee168108d37a6421a Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Sat, 19 Dec 2020 00:23:14 +0100 Subject: [PATCH 04/26] Refactor: GuestAuthorization plugin --- .../Webapi/Model/Plugin/GuestAuthorization.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Webapi/Model/Plugin/GuestAuthorization.php b/app/code/Magento/Webapi/Model/Plugin/GuestAuthorization.php index 78082fab8bd9c..31a941ebfea19 100644 --- a/app/code/Magento/Webapi/Model/Plugin/GuestAuthorization.php +++ b/app/code/Magento/Webapi/Model/Plugin/GuestAuthorization.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Webapi\Model\Plugin; @@ -11,7 +12,7 @@ /** * Plugin around \Magento\Framework\Authorization::isAllowed * - * Plugin to allow guest users to access resources with anonymous permission + * Allow guest users to access resources with "anonymous" resource */ class GuestAuthorization { @@ -22,8 +23,7 @@ class GuestAuthorization * @param \Closure $proceed * @param string $resource * @param string $privilege - * @return bool true If resource permission is anonymous, - * to allow any user access without further checks in parent method + * @return bool Is resource permission "anonymous", to allow any user access without further checks in parent method * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundIsAllowed( @@ -32,10 +32,10 @@ public function aroundIsAllowed( $resource, $privilege = null ) { - if ($resource == AuthorizationService::PERMISSION_ANONYMOUS) { + if ($resource === AuthorizationService::PERMISSION_ANONYMOUS) { return true; - } else { - return $proceed($resource, $privilege); } + + return $proceed($resource, $privilege); } } From 268d2bbefeecb980c6fbe48d1974f7ebe8fdb1b1 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Sat, 19 Dec 2020 00:24:18 +0100 Subject: [PATCH 05/26] Refactor: PriceBackend plugin --- app/code/Magento/Bundle/Model/Plugin/PriceBackend.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Bundle/Model/Plugin/PriceBackend.php b/app/code/Magento/Bundle/Model/Plugin/PriceBackend.php index 1914d5b5146c3..bed74f8d239aa 100644 --- a/app/code/Magento/Bundle/Model/Plugin/PriceBackend.php +++ b/app/code/Magento/Bundle/Model/Plugin/PriceBackend.php @@ -1,14 +1,15 @@ Date: Sat, 19 Dec 2020 00:25:31 +0100 Subject: [PATCH 06/26] Refactor: Widget Layout ResourceModel plugin --- .../Model/ResourceModel/Layout/Plugin.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php b/app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php index 5525520fa1da0..7f50dfe6b629d 100644 --- a/app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php +++ b/app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php @@ -1,32 +1,29 @@ update = $update; } /** - * Around getDbUpdateString - * * @param \Magento\Framework\View\Model\Layout\Merge $subject * @param callable $proceed * @param string $handle From a2f9e4b8d14d764e66dfacfd8866b39da99016ba Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 28 Sep 2021 22:21:27 +0100 Subject: [PATCH 07/26] Set process title when running cron job --- app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 0f266b5d62d83..b5eb6fdc85a17 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -339,6 +339,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, ); } + cli_set_process_title("Magento cron - group=$groupId - job=$jobCode"); $schedule->setExecutedAt(strftime('%Y-%m-%d %H:%M:%S', $this->dateTime->gmtTimestamp())); $this->retrier->execute( function () use ($schedule) { From 0ac321b79ba079a5c4bec42b1d770e10364c8726 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 30 Sep 2021 22:58:49 +0100 Subject: [PATCH 08/26] Preserve (most of the) original command line title --- .../Observer/ProcessCronQueueObserver.php | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index b5eb6fdc85a17..00d2a4d68f41c 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -9,6 +9,7 @@ */ namespace Magento\Cron\Observer; +use Laminas\Http\PhpEnvironment\Request; use Magento\Cron\Model\ResourceModel\Schedule\Collection as ScheduleCollection; use Magento\Cron\Model\Schedule; use Magento\Framework\App\State; @@ -128,6 +129,16 @@ class ProcessCronQueueObserver implements ObserverInterface */ protected $dateTime; + /** + * @var Request + */ + protected Request $environment; + + /** + * @var string + */ + protected string $originalProcessTitle; + /** * @var \Symfony\Component\Process\PhpExecutableFinder */ @@ -201,7 +212,8 @@ public function __construct( StatFactory $statFactory, \Magento\Framework\Lock\LockManagerInterface $lockManager, \Magento\Framework\Event\ManagerInterface $eventManager, - DeadlockRetrierInterface $retrier + DeadlockRetrierInterface $retrier, + Request $environment ) { $this->_objectManager = $objectManager; $this->_scheduleFactory = $scheduleFactory; @@ -211,6 +223,7 @@ public function __construct( $this->_request = $request; $this->_shell = $shell; $this->dateTime = $dateTime; + $this->environment = $environment; $this->phpExecutableFinder = $phpExecutableFinderFactory->create(); $this->logger = $logger; $this->state = $state; @@ -339,7 +352,17 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, ); } - cli_set_process_title("Magento cron - group=$groupId - job=$jobCode"); + if (!isset($this->originalProcessTitle)) { + $this->originalProcessTitle = implode(' ', $this->environment->getServer('argv')); + } + + if (strpos($this->originalProcessTitle, " --group=$groupId ") !== false) { + // Group is already shown, so no need to include here in duplicate + cli_set_process_title($this->originalProcessTitle . " # job: $jobCode"); + } else { + cli_set_process_title($this->originalProcessTitle . " # group: $groupId, job: $jobCode"); + } + $schedule->setExecutedAt(strftime('%Y-%m-%d %H:%M:%S', $this->dateTime->gmtTimestamp())); $this->retrier->execute( function () use ($schedule) { From 3613f8096fbd3faa7add9ad8611dfe413d7fba72 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 30 Sep 2021 23:00:50 +0100 Subject: [PATCH 09/26] Correct docblock --- app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 00d2a4d68f41c..80106512b7809 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -195,6 +195,7 @@ class ProcessCronQueueObserver implements ObserverInterface * @param \Magento\Framework\Lock\LockManagerInterface $lockManager * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param DeadlockRetrierInterface $retrier + * @param Request $environment * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( From 55bf25eb5af5440b5330d19a6fcabb3a8fe5635d Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Fri, 1 Oct 2021 22:34:41 +0100 Subject: [PATCH 10/26] Include PHP_BINARY in process title --- app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 80106512b7809..77e33fbfbf0d2 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -354,7 +354,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, } if (!isset($this->originalProcessTitle)) { - $this->originalProcessTitle = implode(' ', $this->environment->getServer('argv')); + $this->originalProcessTitle = PHP_BINARY . ' ' . implode(' ', $this->environment->getServer('argv')); } if (strpos($this->originalProcessTitle, " --group=$groupId ") !== false) { From a9f50039cb2d32b0394f626654d7d7e335fcffa3 Mon Sep 17 00:00:00 2001 From: Erfan Date: Mon, 4 Oct 2021 15:08:19 +0800 Subject: [PATCH 11/26] Added topic name to error message --- .../Config/QueueConfigItem/DataMapperTest.php | 43 +++++++++++++++++++ .../Config/QueueConfigItem/DataMapper.php | 4 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Topology/Config/QueueConfigItem/DataMapperTest.php b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Topology/Config/QueueConfigItem/DataMapperTest.php index 46ea82b887db6..80987d762152b 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Topology/Config/QueueConfigItem/DataMapperTest.php +++ b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Topology/Config/QueueConfigItem/DataMapperTest.php @@ -14,6 +14,7 @@ use Magento\Framework\MessageQueue\Rpc\ResponseQueueNameBuilder; use Magento\Framework\MessageQueue\Topology\Config\Data; use Magento\Framework\MessageQueue\Topology\Config\QueueConfigItem\DataMapper; +use Magento\Framework\Phrase; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -289,4 +290,46 @@ public function testGetMappedDataForWildcard(): void ]; $this->assertEquals($expectedResult, $actualResult); } + + /** + * @return void + */ + public function testTopicIsSynchronousException(): void + { + $topicName = 'topic01'; + $data = [ + 'ex01' => [ + 'name' => 'ex01', + 'type' => 'topic', + 'connection' => 'amqp', + 'durable' => true, + 'internal' => false, + 'autoDelete' => false, + 'arguments' => ['some' => 'argument'], + 'bindings' => [ + 'bind01' => [ + 'id' => 'bind01', + 'topic' => $topicName, + 'destinationType' => 'queue', + 'destination' => 'some.queue', + 'disabled' => false, + 'arguments' => ['some' => 'arguments'], + ], + ], + ], + ]; + + $this->communicationConfigMock->expects($this->exactly(1)) + ->method('getTopic') + ->willThrowException(new LocalizedException( + new Phrase('Topic "%topic" is not configured.', ['topic' => $topicName]) + )); + + $this->configDataMock->expects($this->once())->method('get')->willReturn($data); + + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage(sprintf('Error while checking if topic "%s" is synchronous', $topicName)); + + $this->model->getMappedData(); + } } diff --git a/lib/internal/Magento/Framework/MessageQueue/Topology/Config/QueueConfigItem/DataMapper.php b/lib/internal/Magento/Framework/MessageQueue/Topology/Config/QueueConfigItem/DataMapper.php index 912aa4a6b0fb1..8e17c45587ee5 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Topology/Config/QueueConfigItem/DataMapper.php +++ b/lib/internal/Magento/Framework/MessageQueue/Topology/Config/QueueConfigItem/DataMapper.php @@ -145,7 +145,9 @@ private function isSynchronousTopic(string $topicName): bool $topic = $this->communicationConfig->getTopic($topicName); return (bool)$topic[CommunicationConfig::TOPIC_IS_SYNCHRONOUS]; } catch (LocalizedException $exception) { - throw new LocalizedException(new Phrase('Error while checking if topic is synchronous')); + throw new LocalizedException( + new Phrase('Error while checking if topic "%topic" is synchronous', ['topic' => $topicName]) + ); } } From 5969ba7608aed1d0ea312ff1b5316f059093c3fc Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Wed, 6 Oct 2021 23:15:08 +0100 Subject: [PATCH 12/26] Fix unit test --- .../Cron/Observer/ProcessCronQueueObserver.php | 10 +++++----- .../Unit/Observer/ProcessCronQueueObserverTest.php | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 77e33fbfbf0d2..ba5f98611937f 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -9,7 +9,7 @@ */ namespace Magento\Cron\Observer; -use Laminas\Http\PhpEnvironment\Request; +use Laminas\Http\PhpEnvironment\Request as Environment; use Magento\Cron\Model\ResourceModel\Schedule\Collection as ScheduleCollection; use Magento\Cron\Model\Schedule; use Magento\Framework\App\State; @@ -130,9 +130,9 @@ class ProcessCronQueueObserver implements ObserverInterface protected $dateTime; /** - * @var Request + * @var Environment */ - protected Request $environment; + protected Environment $environment; /** * @var string @@ -195,7 +195,7 @@ class ProcessCronQueueObserver implements ObserverInterface * @param \Magento\Framework\Lock\LockManagerInterface $lockManager * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param DeadlockRetrierInterface $retrier - * @param Request $environment + * @param Environment $environment * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -214,7 +214,7 @@ public function __construct( \Magento\Framework\Lock\LockManagerInterface $lockManager, \Magento\Framework\Event\ManagerInterface $eventManager, DeadlockRetrierInterface $retrier, - Request $environment + Environment $environment ) { $this->_objectManager = $objectManager; $this->_scheduleFactory = $scheduleFactory; diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index 26b844a22a548..28849d388cba3 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -8,6 +8,7 @@ namespace Magento\Cron\Test\Unit\Observer; use Exception; +use Laminas\Http\PhpEnvironment\Request as Environment; use Magento\Cron\Model\Config; use Magento\Cron\Model\DeadlockRetrierInterface; use Magento\Cron\Model\ResourceModel\Schedule as ScheduleResourceModel; @@ -20,8 +21,8 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Console\Request as ConsoleRequest; use Magento\Framework\App\ObjectManager; -use Magento\Framework\App\State; use Magento\Framework\App\State as AppState; +use Magento\Framework\App\State; use Magento\Framework\DataObject; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Event\ManagerInterface; @@ -219,6 +220,14 @@ protected function setUp(): void $this->retrierMock = $this->getMockForAbstractClass(DeadlockRetrierInterface::class); + $environmentMock = $this->getMockBuilder(Environment::class) + ->disableOriginalConstructor() + ->getMock(); + $environmentMock->expects($this->any()) + ->method('getServer') + ->with('argv') + ->willReturn($_SERVER['argv']); + $this->cronQueueObserver = new ProcessCronQueueObserver( $this->objectManagerMock, $this->scheduleFactoryMock, @@ -234,7 +243,8 @@ protected function setUp(): void $this->statFactory, $this->lockManagerMock, $this->eventManager, - $this->retrierMock + $this->retrierMock, + $environmentMock ); } From 07cabe45de60e76246c9fd177913a6b2c5cb9c4c Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 25 Oct 2021 22:38:32 +0100 Subject: [PATCH 13/26] Reduce property visibility --- app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index ba5f98611937f..6eeb7189d83f6 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -132,12 +132,12 @@ class ProcessCronQueueObserver implements ObserverInterface /** * @var Environment */ - protected Environment $environment; + private Environment $environment; /** * @var string */ - protected string $originalProcessTitle; + private string $originalProcessTitle; /** * @var \Symfony\Component\Process\PhpExecutableFinder From 4cca4c7df602d735262988f5a9586391450cb860 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sat, 27 Nov 2021 13:02:50 +0000 Subject: [PATCH 14/26] Recover from failed merge conflict resolution --- app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index f53cbfda133c0..5e32fad035583 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -376,7 +376,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, cli_set_process_title($this->originalProcessTitle . " # group: $groupId, job: $jobCode"); } - $schedule->setExecutedAt(strftime('%Y-%m-%d %H:%M:%S', $this->dateTime->gmtTimestamp())); + $schedule->setExecutedAt(date('Y-m-d H:i:s', $this->dateTime->gmtTimestamp())); $this->retrier->execute( function () use ($schedule) { $schedule->save(); From ae72fdd165544ca2ba47e4c6d6451f2207c1d397 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sat, 27 Nov 2021 13:03:41 +0000 Subject: [PATCH 15/26] Extract new feature to its own method --- .../Observer/ProcessCronQueueObserver.php | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 5e32fad035583..1085dcce64bbf 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -365,16 +365,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, ); } - if (!isset($this->originalProcessTitle)) { - $this->originalProcessTitle = PHP_BINARY . ' ' . implode(' ', $this->environment->getServer('argv')); - } - - if (strpos($this->originalProcessTitle, " --group=$groupId ") !== false) { - // Group is already shown, so no need to include here in duplicate - cli_set_process_title($this->originalProcessTitle . " # job: $jobCode"); - } else { - cli_set_process_title($this->originalProcessTitle . " # group: $groupId, job: $jobCode"); - } + $this->setProcessTitle($jobCode, $groupId); $schedule->setExecutedAt(date('Y-m-d H:i:s', $this->dateTime->gmtTimestamp())); $this->retrier->execute( @@ -954,4 +945,24 @@ function () use ($scheduleResource, $where) { $scheduleResource->getConnection() ); } + + /** + * Set the process title to include the job code and group + * + * @param string $jobCode + * @param string $groupId + */ + private function setProcessTitle(string $jobCode, string $groupId): void + { + if (!isset($this->originalProcessTitle)) { + $this->originalProcessTitle = PHP_BINARY . ' ' . implode(' ', $this->environment->getServer('argv')); + } + + if (strpos($this->originalProcessTitle, " --group=$groupId ") !== false) { + // Group is already shown, so no need to include here in duplicate + cli_set_process_title($this->originalProcessTitle . " # job: $jobCode"); + } else { + cli_set_process_title($this->originalProcessTitle . " # group: $groupId, job: $jobCode"); + } + } } From c584355fa59e5a321535aebb22638e2b5e532586 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sat, 27 Nov 2021 13:05:20 +0000 Subject: [PATCH 16/26] Set required visibility on consts --- .../Observer/ProcessCronQueueObserver.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 1085dcce64bbf..95211a8d3622d 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -35,59 +35,59 @@ class ProcessCronQueueObserver implements ObserverInterface /**#@+ * Cache key values */ - const CACHE_KEY_LAST_SCHEDULE_GENERATE_AT = 'cron_last_schedule_generate_at'; + public const CACHE_KEY_LAST_SCHEDULE_GENERATE_AT = 'cron_last_schedule_generate_at'; - const CACHE_KEY_LAST_HISTORY_CLEANUP_AT = 'cron_last_history_cleanup_at'; + public const CACHE_KEY_LAST_HISTORY_CLEANUP_AT = 'cron_last_history_cleanup_at'; /** * Flag for internal communication between processes for running * all jobs in a group in parallel as a separate process */ - const STANDALONE_PROCESS_STARTED = 'standaloneProcessStarted'; + public const STANDALONE_PROCESS_STARTED = 'standaloneProcessStarted'; /**#@-*/ /**#@+ * List of configurable constants used to calculate and validate during handling cron jobs */ - const XML_PATH_SCHEDULE_GENERATE_EVERY = 'schedule_generate_every'; + public const XML_PATH_SCHEDULE_GENERATE_EVERY = 'schedule_generate_every'; - const XML_PATH_SCHEDULE_AHEAD_FOR = 'schedule_ahead_for'; + public const XML_PATH_SCHEDULE_AHEAD_FOR = 'schedule_ahead_for'; - const XML_PATH_SCHEDULE_LIFETIME = 'schedule_lifetime'; + public const XML_PATH_SCHEDULE_LIFETIME = 'schedule_lifetime'; - const XML_PATH_HISTORY_CLEANUP_EVERY = 'history_cleanup_every'; + public const XML_PATH_HISTORY_CLEANUP_EVERY = 'history_cleanup_every'; - const XML_PATH_HISTORY_SUCCESS = 'history_success_lifetime'; + public const XML_PATH_HISTORY_SUCCESS = 'history_success_lifetime'; - const XML_PATH_HISTORY_FAILURE = 'history_failure_lifetime'; + public const XML_PATH_HISTORY_FAILURE = 'history_failure_lifetime'; /**#@-*/ /** * Value of seconds in one minute */ - const SECONDS_IN_MINUTE = 60; + public const SECONDS_IN_MINUTE = 60; /** * How long to wait for cron group to become unlocked */ - const LOCK_TIMEOUT = 60; + public const LOCK_TIMEOUT = 60; /** * Static lock prefix for cron group locking */ - const LOCK_PREFIX = 'CRON_'; + public const LOCK_PREFIX = 'CRON_'; /** * Timer ID for profiling */ - const CRON_TIMERID = 'job %s'; + public const CRON_TIMERID = 'job %s'; /** * Max retries for acquire locks for cron jobs */ - const MAX_RETRIES = 5; + public const MAX_RETRIES = 5; /** * @var ScheduleCollection From 9a71f4ecc7f718104ba3d69f863471f99f8eac79 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 6 Jan 2022 13:10:07 +0000 Subject: [PATCH 17/26] Remove use of superglobal --- .../Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index 0a0e1193d2efa..1a67056c24e17 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -226,7 +226,7 @@ protected function setUp(): void $environmentMock->expects($this->any()) ->method('getServer') ->with('argv') - ->willReturn($_SERVER['argv']); + ->willReturn([]); $this->cronQueueObserver = new ProcessCronQueueObserver( $this->objectManagerMock, From dce6e9d50f5db673b7feaa4e1dd7eb290f237ef4 Mon Sep 17 00:00:00 2001 From: Peter Jaap Blaakmeer Date: Thu, 3 Nov 2022 12:14:48 +0100 Subject: [PATCH 18/26] Do not use store code in URLs when site is in single store mode --- app/code/Magento/Store/Model/Store.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index 97df81ff6ab7e..b3f19954ab075 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -21,6 +21,7 @@ use Magento\Framework\Url\ScopeInterface as UrlScopeInterface; use Magento\Framework\UrlInterface; use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\StoreManager; /** * Store model @@ -760,6 +761,7 @@ protected function _updatePathUseStoreView($url) public function isUseStoreInUrl() { return !($this->hasDisableStoreInUrl() && $this->getDisableStoreInUrl()) + && !$this->getConfig(StoreManager::XML_PATH_SINGLE_STORE_MODE_ENABLED) && $this->getConfig(self::XML_PATH_STORE_IN_URL); } From b2fd12161cdd2aa1524637307994f77b084a24ee Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Thu, 10 Nov 2022 10:10:38 +0100 Subject: [PATCH 19/26] Allow more htmlClasses --- lib/internal/Magento/Framework/View/Layout/etc/elements.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd b/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd index e1bdfb81fd732..617d886af901c 100644 --- a/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd +++ b/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd @@ -119,7 +119,7 @@ - + From f92c6a10058f1b6839d37e4a07369c2614fa1389 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Tue, 29 Nov 2022 20:39:10 +0100 Subject: [PATCH 20/26] Allow more classes --- lib/internal/Magento/Framework/View/Layout/etc/elements.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd b/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd index 617d886af901c..aa7e5ee273b4e 100644 --- a/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd +++ b/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd @@ -119,7 +119,7 @@ - + From 6da701759e6f8109e2f5e5e3b19f81d73caa9979 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Fri, 2 Dec 2022 14:11:40 +0100 Subject: [PATCH 21/26] Update elements.xsd --- lib/internal/Magento/Framework/View/Layout/etc/elements.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd b/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd index aa7e5ee273b4e..eaddeed95c7a3 100644 --- a/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd +++ b/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd @@ -119,7 +119,7 @@ - + From f8ddccf7b9bf457a9574c4fa53f4736682377bca Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 5 Dec 2022 20:03:04 +0100 Subject: [PATCH 22/26] Update elements.xsd --- lib/internal/Magento/Framework/View/Layout/etc/elements.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd b/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd index eaddeed95c7a3..fd674063efca7 100644 --- a/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd +++ b/lib/internal/Magento/Framework/View/Layout/etc/elements.xsd @@ -119,7 +119,7 @@ - + From 36809f8de5809cb309690fc4f86d8e04bdd67e77 Mon Sep 17 00:00:00 2001 From: Peter Jaap Blaakmeer Date: Mon, 9 Jan 2023 15:22:45 +0100 Subject: [PATCH 23/26] Updated StoreTest --- .../Magento/Store/Model/StoreTest.php | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php index d81a6fa52ea48..500c250be1bda 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php @@ -446,10 +446,11 @@ public function saveValidationDataProvider() /** * @param $storeInUrl * @param $disableStoreInUrl + * @param $singleStoreModeEnabled * @param $expectedResult * @dataProvider isUseStoreInUrlDataProvider */ - public function testIsUseStoreInUrl($storeInUrl, $disableStoreInUrl, $expectedResult) + public function testIsUseStoreInUrl($storeInUrl, $disableStoreInUrl, $singleStoreModeEnabled, $expectedResult) { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $configMock = $this->createMock(\Magento\Framework\App\Config\ReinitableConfigInterface::class); @@ -464,6 +465,11 @@ public function testIsUseStoreInUrl($storeInUrl, $disableStoreInUrl, $expectedRe ->with($this->stringContains(Store::XML_PATH_STORE_IN_URL)) ->willReturn($storeInUrl); + $configMock->expects($this->any()) + ->method('getValue') + ->with($this->stringContains(StoreManager::XML_PATH_SINGLE_STORE_MODE_ENABLED)) + ->willReturn($singleStoreModeEnabled); + $params['config'] = $configMock; $model = $objectManager->create(\Magento\Store\Model\Store::class, $params); $model->setDisableStoreInUrl($disableStoreInUrl); @@ -477,10 +483,14 @@ public function testIsUseStoreInUrl($storeInUrl, $disableStoreInUrl, $expectedRe public function isUseStoreInUrlDataProvider() { return [ - [true, null, true], - [false, null, false], - [true, true, false], - [true, false, true] + [true, null, false, true], + [false, null, false, false], + [true, true, false, false], + [true, false, false, true], + [true, null, true, false], + [false, null, true, false], + [true, true, true, false], + [true, false, true, false] ]; } From e2387e3acf5000c114b68f1230ad6572c709cbd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cengcom-Echo=E2=80=9D?= Date: Tue, 24 Jan 2023 15:22:38 +0530 Subject: [PATCH 24/26] Fixed Integration Test --- .../testsuite/Magento/Store/Model/StoreTest.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php index 500c250be1bda..bd83561a8a324 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php @@ -460,15 +460,13 @@ public function testIsUseStoreInUrl($storeInUrl, $disableStoreInUrl, $singleStor $params['context'] = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create(\Magento\Framework\Model\Context::class, ['appState' => $appStateMock]); - $configMock->expects($this->any()) + $configMock ->method('getValue') - ->with($this->stringContains(Store::XML_PATH_STORE_IN_URL)) - ->willReturn($storeInUrl); - - $configMock->expects($this->any()) - ->method('getValue') - ->with($this->stringContains(StoreManager::XML_PATH_SINGLE_STORE_MODE_ENABLED)) - ->willReturn($singleStoreModeEnabled); + ->withConsecutive( + [$this->stringContains(StoreManager::XML_PATH_SINGLE_STORE_MODE_ENABLED)], + [$this->stringContains(Store::XML_PATH_STORE_IN_URL)] + ) + ->willReturnOnConsecutiveCalls($singleStoreModeEnabled, $storeInUrl); $params['config'] = $configMock; $model = $objectManager->create(\Magento\Store\Model\Store::class, $params); From 8b57109974b665c8e4e76326ab1bb380452bdb69 Mon Sep 17 00:00:00 2001 From: abhattGlo Date: Mon, 13 Feb 2023 16:45:54 +0530 Subject: [PATCH 25/26] Fixed static tests failures --- app/code/Magento/Bundle/Model/Plugin/PriceBackend.php | 2 ++ .../Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php | 2 ++ app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/code/Magento/Bundle/Model/Plugin/PriceBackend.php b/app/code/Magento/Bundle/Model/Plugin/PriceBackend.php index bed74f8d239aa..c55500b8461f3 100644 --- a/app/code/Magento/Bundle/Model/Plugin/PriceBackend.php +++ b/app/code/Magento/Bundle/Model/Plugin/PriceBackend.php @@ -14,6 +14,8 @@ class PriceBackend { /** + * Around validate + * * @param \Magento\Catalog\Model\Product\Attribute\Backend\Price $subject * @param \Closure $proceed * @param \Magento\Catalog\Model\Product|\Magento\Framework\DataObject $object diff --git a/app/code/Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php b/app/code/Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php index a20212c74fbe7..d4b33aa36c044 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php +++ b/app/code/Magento/ConfigurableProduct/Model/Plugin/PriceBackend.php @@ -16,6 +16,8 @@ class PriceBackend { /** + * Around validate + * * @param \Magento\Catalog\Model\Product\Attribute\Backend\Price $subject * @param \Closure $proceed * @param \Magento\Catalog\Model\Product|\Magento\Framework\DataObject $object diff --git a/app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php b/app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php index 7f50dfe6b629d..7a5bd777efe6b 100644 --- a/app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php +++ b/app/code/Magento/Widget/Model/ResourceModel/Layout/Plugin.php @@ -24,6 +24,8 @@ public function __construct(Update $update) } /** + * Around update + * * @param \Magento\Framework\View\Model\Layout\Merge $subject * @param callable $proceed * @param string $handle From 50e3360fb1186f6b89acdedcb70db50cc28656ec Mon Sep 17 00:00:00 2001 From: engcom-Charlie Date: Tue, 14 Feb 2023 12:20:08 +0530 Subject: [PATCH 26/26] Fixed static test failures --- app/code/Magento/Swatches/Helper/Data.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Swatches/Helper/Data.php b/app/code/Magento/Swatches/Helper/Data.php index f122a02c70f86..ede204a5e21b8 100644 --- a/app/code/Magento/Swatches/Helper/Data.php +++ b/app/code/Magento/Swatches/Helper/Data.php @@ -30,12 +30,12 @@ class Data /** * When we init media gallery empty image types contain this value. */ - const EMPTY_IMAGE_VALUE = 'no_selection'; + public const EMPTY_IMAGE_VALUE = 'no_selection'; /** * The int value of the Default store ID */ - const DEFAULT_STORE_ID = 0; + public const DEFAULT_STORE_ID = 0; /** * @var CollectionFactory