From 620d14d01365a1907f4abc19b3c50882aef86c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gheolt=CC=A6an?= Date: Sun, 14 Oct 2018 18:29:29 +0300 Subject: [PATCH 01/89] Binding to event collapsible scroll --- lib/web/mage/collapsible.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/web/mage/collapsible.js b/lib/web/mage/collapsible.js index 69e576bba604a..a6a1dcde6c87a 100644 --- a/lib/web/mage/collapsible.js +++ b/lib/web/mage/collapsible.js @@ -63,6 +63,12 @@ define([ this.icons = true; } + this.element.on('dimensionsChanged',function(e) { + if(e.target && e.target.classList.contains('active')) { + this._scrollToTopIfVisible(e.target); + } + }.bind(this)); + this._bind('click'); this._trigger('created'); }, @@ -453,9 +459,6 @@ define([ if (this.options.animate) { this._animate(showProps); } else { - if (this.content.length) { - this._scrollToTopIfVisible(this.content.get(0).parentElement); - } this.content.show(); } this._open(); From 087257703657d85bf06a9cf78f9efc80151389eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gheolt=CC=A6an?= Date: Sun, 14 Oct 2018 18:45:52 +0300 Subject: [PATCH 02/89] Binding to event collapsible scroll --- lib/web/mage/collapsible.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/mage/collapsible.js b/lib/web/mage/collapsible.js index a6a1dcde6c87a..3d283d102e323 100644 --- a/lib/web/mage/collapsible.js +++ b/lib/web/mage/collapsible.js @@ -63,8 +63,8 @@ define([ this.icons = true; } - this.element.on('dimensionsChanged',function(e) { - if(e.target && e.target.classList.contains('active')) { + this.element.on('dimensionsChanged', function (e) { + if (e.target && e.target.classList.contains('active')) { this._scrollToTopIfVisible(e.target); } }.bind(this)); From 12b7e08c2f262d0683e5b61d5fd2487aac19c27d Mon Sep 17 00:00:00 2001 From: Fabian Schmengler Date: Tue, 16 Oct 2018 09:21:09 +0200 Subject: [PATCH 03/89] Set cache id prefix on installation --- .../Setup/Model/ConfigOptionsList/Cache.php | 23 ++++++ .../Model/ConfigOptionsList/PageCache.php | 23 ++++++ .../Model/ConfigOptionsList/CacheTest.php | 70 +++++++++++++++++- .../Model/ConfigOptionsList/PageCacheTest.php | 71 ++++++++++++++++++- 4 files changed, 181 insertions(+), 6 deletions(-) diff --git a/setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php b/setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php index 2f19f010c1704..85c0e2c4e9b3b 100644 --- a/setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php +++ b/setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php @@ -27,12 +27,14 @@ class Cache implements ConfigOptionsListInterface const INPUT_KEY_CACHE_BACKEND_REDIS_DATABASE = 'cache-backend-redis-db'; const INPUT_KEY_CACHE_BACKEND_REDIS_PORT = 'cache-backend-redis-port'; const INPUT_KEY_CACHE_BACKEND_REDIS_PASSWORD = 'cache-backend-redis-password'; + const INPUT_KEY_CACHE_ID_PREFIX = 'cache-id-prefix'; const CONFIG_PATH_CACHE_BACKEND = 'cache/frontend/default/backend'; const CONFIG_PATH_CACHE_BACKEND_SERVER = 'cache/frontend/default/backend_options/server'; const CONFIG_PATH_CACHE_BACKEND_DATABASE = 'cache/frontend/default/backend_options/database'; const CONFIG_PATH_CACHE_BACKEND_PORT = 'cache/frontend/default/backend_options/port'; const CONFIG_PATH_CACHE_BACKEND_PASSWORD = 'cache/frontend/default/backend_options/password'; + const CONFIG_PATH_CACHE_ID_PREFIX = 'cache/frontend/default/id_prefix'; /** * @var array @@ -112,6 +114,12 @@ public function getOptions() TextConfigOption::FRONTEND_WIZARD_TEXT, self::CONFIG_PATH_CACHE_BACKEND_PASSWORD, 'Redis server password' + ), + new TextConfigOption( + self::INPUT_KEY_CACHE_ID_PREFIX, + TextConfigOption::FRONTEND_WIZARD_TEXT, + self::CONFIG_PATH_CACHE_ID_PREFIX, + 'ID prefix for cache keys' ) ]; } @@ -122,6 +130,11 @@ public function getOptions() public function createConfig(array $options, DeploymentConfig $deploymentConfig) { $configData = new ConfigData(ConfigFilePool::APP_ENV); + if (isset($options[self::INPUT_KEY_CACHE_ID_PREFIX])) { + $configData->set(self::CONFIG_PATH_CACHE_ID_PREFIX, $options[self::INPUT_KEY_CACHE_ID_PREFIX]); + } else { + $configData->set(self::CONFIG_PATH_CACHE_ID_PREFIX, $this->generateCachePrefix()); + } if (isset($options[self::INPUT_KEY_CACHE_BACKEND])) { if ($options[self::INPUT_KEY_CACHE_BACKEND] == self::INPUT_VALUE_CACHE_REDIS) { @@ -241,4 +254,14 @@ private function getDefaultConfigValue($inputKey) return ''; } } + + /** + * Generate default cache ID prefix based on installation dir + * + * @return string + */ + private function generateCachePrefix(): string + { + return substr(\md5(dirname(__DIR__, 6)), 0, 3) . '_'; + } } diff --git a/setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php b/setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php index c288b4dd51d65..35a9955aad506 100644 --- a/setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php +++ b/setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php @@ -28,6 +28,7 @@ class PageCache implements ConfigOptionsListInterface const INPUT_KEY_PAGE_CACHE_BACKEND_REDIS_PORT = 'page-cache-redis-port'; const INPUT_KEY_PAGE_CACHE_BACKEND_REDIS_COMPRESS_DATA = 'page-cache-redis-compress-data'; const INPUT_KEY_PAGE_CACHE_BACKEND_REDIS_PASSWORD = 'page-cache-redis-password'; + const INPUT_KEY_PAGE_CACHE_ID_PREFIX = 'page-cache-id-prefix'; const CONFIG_PATH_PAGE_CACHE_BACKEND = 'cache/frontend/page_cache/backend'; const CONFIG_PATH_PAGE_CACHE_BACKEND_SERVER = 'cache/frontend/page_cache/backend_options/server'; @@ -35,6 +36,7 @@ class PageCache implements ConfigOptionsListInterface const CONFIG_PATH_PAGE_CACHE_BACKEND_PORT = 'cache/frontend/page_cache/backend_options/port'; const CONFIG_PATH_PAGE_CACHE_BACKEND_COMPRESS_DATA = 'cache/frontend/page_cache/backend_options/compress_data'; const CONFIG_PATH_PAGE_CACHE_BACKEND_PASSWORD = 'cache/frontend/page_cache/backend_options/password'; + const CONFIG_PATH_PAGE_CACHE_ID_PREFIX = 'cache/frontend/page_cache/id_prefix'; /** * @var array @@ -122,6 +124,12 @@ public function getOptions() TextConfigOption::FRONTEND_WIZARD_TEXT, self::CONFIG_PATH_PAGE_CACHE_BACKEND_PASSWORD, 'Redis server password' + ), + new TextConfigOption( + self::INPUT_KEY_PAGE_CACHE_ID_PREFIX, + TextConfigOption::FRONTEND_WIZARD_TEXT, + self::CONFIG_PATH_PAGE_CACHE_ID_PREFIX, + 'ID prefix for cache keys' ) ]; } @@ -132,6 +140,11 @@ public function getOptions() public function createConfig(array $options, DeploymentConfig $deploymentConfig) { $configData = new ConfigData(ConfigFilePool::APP_ENV); + if (isset($options[self::INPUT_KEY_PAGE_CACHE_ID_PREFIX])) { + $configData->set(self::CONFIG_PATH_PAGE_CACHE_ID_PREFIX, $options[self::INPUT_KEY_PAGE_CACHE_ID_PREFIX]); + } else { + $configData->set(self::CONFIG_PATH_PAGE_CACHE_ID_PREFIX, $this->generateCachePrefix()); + } if (isset($options[self::INPUT_KEY_PAGE_CACHE_BACKEND])) { if ($options[self::INPUT_KEY_PAGE_CACHE_BACKEND] == self::INPUT_VALUE_PAGE_CACHE_REDIS) { @@ -252,4 +265,14 @@ private function getDefaultConfigValue($inputKey) return ''; } } + + /** + * Generate default cache ID prefix based on installation dir + * + * @return string + */ + private function generateCachePrefix(): string + { + return substr(\md5(dirname(__DIR__, 6)), 0, 3) . '_'; + } } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/CacheTest.php b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/CacheTest.php index 1bbd2e671e59a..9c123fcb330dd 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/CacheTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/CacheTest.php @@ -45,7 +45,7 @@ protected function setUp() public function testGetOptions() { $options = $this->configOptionsList->getOptions(); - $this->assertCount(5, $options); + $this->assertCount(6, $options); $this->assertArrayHasKey(0, $options); $this->assertInstanceOf(SelectConfigOption::class, $options[0]); @@ -66,6 +66,10 @@ public function testGetOptions() $this->assertArrayHasKey(4, $options); $this->assertInstanceOf(TextConfigOption::class, $options[4]); $this->assertEquals('cache-backend-redis-password', $options[4]->getName()); + + $this->assertArrayHasKey(5, $options); + $this->assertInstanceOf(TextConfigOption::class, $options[5]); + $this->assertEquals('cache-id-prefix', $options[5]->getName()); } /** @@ -85,7 +89,8 @@ public function testCreateConfigCacheRedis() 'port' => '', 'database' => '', 'password' => '' - ] + ], + 'id_prefix' => $this->expectedIdPrefix(), ] ] ] @@ -111,7 +116,8 @@ public function testCreateConfigWithRedisConfig() 'port' => '1234', 'database' => '5', 'password' => '' - ] + ], + 'id_prefix' => $this->expectedIdPrefix(), ] ] ] @@ -128,6 +134,54 @@ public function testCreateConfigWithRedisConfig() $this->assertEquals($expectedConfigData, $configData->getData()); } + /** + * testCreateConfigCacheRedis + */ + public function testCreateConfigWithFileCache() + { + $this->deploymentConfigMock->method('get')->willReturn(''); + + $expectedConfigData = [ + 'cache' => [ + 'frontend' => [ + 'default' => [ + 'id_prefix' => $this->expectedIdPrefix(), + ] + ] + ] + ]; + + $configData = $this->configOptionsList->createConfig([], $this->deploymentConfigMock); + + $this->assertEquals($expectedConfigData, $configData->getData()); + } + + /** + * testCreateConfigCacheRedis + */ + public function testCreateConfigWithIdPrefix() + { + $this->deploymentConfigMock->method('get')->willReturn(''); + + $explicitPrefix = 'XXX_'; + $expectedConfigData = [ + 'cache' => [ + 'frontend' => [ + 'default' => [ + 'id_prefix' => $explicitPrefix, + ] + ] + ] + ]; + + $configData = $this->configOptionsList->createConfig( + ['cache-id-prefix' => $explicitPrefix], + $this->deploymentConfigMock + ); + + $this->assertEquals($expectedConfigData, $configData->getData()); + } + /** * testValidateWithValidInput */ @@ -160,4 +214,14 @@ public function testValidateWithInvalidInput() $this->assertCount(1, $errors); $this->assertEquals("Invalid cache handler 'clay-tablet'", $errors[0]); } + + /** + * The default ID prefix, based on installation directory + * + * @return string + */ + private function expectedIdPrefix(): string + { + return substr(\md5(dirname(__DIR__, 8)), 0, 3) . '_'; + } } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php index 6f8e97cd5dd8d..d804266096f7b 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php @@ -45,7 +45,7 @@ protected function setUp() public function testGetOptions() { $options = $this->configList->getOptions(); - $this->assertCount(6, $options); + $this->assertCount(7, $options); $this->assertArrayHasKey(0, $options); $this->assertInstanceOf(SelectConfigOption::class, $options[0]); @@ -70,6 +70,10 @@ public function testGetOptions() $this->assertArrayHasKey(5, $options); $this->assertInstanceOf(TextConfigOption::class, $options[5]); $this->assertEquals('page-cache-redis-password', $options[5]->getName()); + + $this->assertArrayHasKey(6, $options); + $this->assertInstanceOf(TextConfigOption::class, $options[6]); + $this->assertEquals('page-cache-id-prefix', $options[6]->getName()); } /** @@ -90,7 +94,8 @@ public function testCreateConfigWithRedis() 'database' => '', 'compress_data' => '', 'password' => '' - ] + ], + 'id_prefix' => $this->expectedIdPrefix(), ] ] ] @@ -117,7 +122,8 @@ public function testCreateConfigWithRedisConfiguration() 'database' => '6', 'compress_data' => '1', 'password' => '' - ] + ], + 'id_prefix' => $this->expectedIdPrefix(), ] ] ] @@ -136,6 +142,55 @@ public function testCreateConfigWithRedisConfiguration() $this->assertEquals($expectedConfigData, $configData->getData()); } + /** + * testCreateConfigWithRedis + */ + public function testCreateConfigWithFileCache() + { + $this->deploymentConfigMock->method('get')->willReturn(''); + + $expectedConfigData = [ + 'cache' => [ + 'frontend' => [ + 'page_cache' => [ + 'id_prefix' => $this->expectedIdPrefix(), + ] + ] + ] + ]; + + $configData = $this->configList->createConfig([], $this->deploymentConfigMock); + + $this->assertEquals($expectedConfigData, $configData->getData()); + } + + + /** + * testCreateConfigCacheRedis + */ + public function testCreateConfigWithIdPrefix() + { + $this->deploymentConfigMock->method('get')->willReturn(''); + + $explicitPrefix = 'XXX_'; + $expectedConfigData = [ + 'cache' => [ + 'frontend' => [ + 'page_cache' => [ + 'id_prefix' => $explicitPrefix, + ] + ] + ] + ]; + + $configData = $this->configList->createConfig( + ['page-cache-id-prefix' => $explicitPrefix], + $this->deploymentConfigMock + ); + + $this->assertEquals($expectedConfigData, $configData->getData()); + } + /** * testValidationWithValidData */ @@ -169,4 +224,14 @@ public function testValidationWithInvalidData() $this->assertCount(1, $errors); $this->assertEquals('Invalid cache handler \'foobar\'', $errors[0]); } + + /** + * The default ID prefix, based on installation directory + * + * @return string + */ + private function expectedIdPrefix(): string + { + return substr(\md5(dirname(__DIR__, 8)), 0, 3) . '_'; + } } From 6c1d07e06eb442a4108db0fe3007f95da2c409e2 Mon Sep 17 00:00:00 2001 From: Henryk Tews Date: Fri, 19 Oct 2018 13:14:10 +0200 Subject: [PATCH 04/89] Changed get product way in blocks with related products --- .../Magento/Catalog/Block/Product/ProductList/Crosssell.php | 2 +- app/code/Magento/Catalog/Block/Product/ProductList/Related.php | 2 +- app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php index 0c547f81c85d6..043704a9f2bca 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php @@ -25,7 +25,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct */ protected function _prepareData() { - $product = $this->_coreRegistry->registry('product'); + $product = $this->getProduct(); /* @var $product \Magento\Catalog\Model\Product */ $this->_itemCollection = $product->getCrossSellProductCollection()->addAttributeToSelect( diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php index 219922f9e46d5..91e4161ce53b1 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php @@ -81,7 +81,7 @@ public function __construct( */ protected function _prepareData() { - $product = $this->_coreRegistry->registry('product'); + $product = $this->getProduct(); /* @var $product \Magento\Catalog\Model\Product */ $this->_itemCollection = $product->getRelatedProductCollection()->addAttributeToSelect( diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index 0d64ecc9bff90..ef38693a5454c 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -95,7 +95,7 @@ public function __construct( */ protected function _prepareData() { - $product = $this->_coreRegistry->registry('product'); + $product = $this->getProduct(); /* @var $product \Magento\Catalog\Model\Product */ $this->_itemCollection = $product->getUpSellProductCollection()->setPositionOrder()->addStoreFilter(); if ($this->moduleManager->isEnabled('Magento_Checkout')) { From 53b5b4902f08c20d7b5ceea85fea8fd8823ae055 Mon Sep 17 00:00:00 2001 From: godvsdeity Date: Wed, 24 Oct 2018 02:00:10 +0300 Subject: [PATCH 05/89] performance improvements Get rid of unnecessary reviews queries on product listing: "select review_entity_summary.* from review_entity_summary where (review_entity_summary.entity_pk_value = ?) and (store_id = ?)" This query was executed for each product on listing which didn't have a review summary(@see: Magento\Review\Block\Product\ReviewRenderer::getReviewsSummaryHtml) --- app/code/Magento/Review/Model/Review.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Review/Model/Review.php b/app/code/Magento/Review/Model/Review.php index c00af3fc61407..e689d4ed460ac 100644 --- a/app/code/Magento/Review/Model/Review.php +++ b/app/code/Magento/Review/Model/Review.php @@ -5,6 +5,7 @@ */ namespace Magento\Review\Model; +use Magento\Framework\DataObject; use Magento\Catalog\Model\Product; use Magento\Framework\DataObject\IdentityInterface; use Magento\Review\Model\ResourceModel\Review\Product\Collection as ProductCollection; @@ -327,6 +328,9 @@ public function appendSummary($collection) $item->setRatingSummary($summary); } } + if (!$item->getRatingSummary()) { + $item->setRatingSummary(new DataObject()); + } } return $this; From 308ac7e212fb2e60418c2b3b8b252fcfa3dc1911 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 24 Oct 2018 11:50:27 +0300 Subject: [PATCH 06/89] MAGETWO-95853: Can't flush Images cache in admin --- .../Framework/Filesystem/Directory/Write.php | 46 ++++++++++++++++++- .../Framework/Filesystem/Driver/File.php | 14 +++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php index 78732d73456f7..74314b747cf42 100644 --- a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php +++ b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php @@ -175,6 +175,7 @@ public function createSymlink($path, $destination, WriteInterface $targetDirecto */ public function delete($path = null) { + $exceptionMessages = []; $this->validatePath($path); if (!$this->isExist($path)) { return true; @@ -183,11 +184,54 @@ public function delete($path = null) if ($this->driver->isFile($absolutePath)) { $this->driver->deleteFile($absolutePath); } else { - $this->driver->deleteDirectory($absolutePath); + try { + $this->deleteFilesRecursively($absolutePath); + $this->driver->deleteDirectory($absolutePath); + } catch (FileSystemException $e) { + $exceptionMessages[] = $e->getMessage(); + } + } + if (!empty($exceptionMessages)) { + throw new FileSystemException( + new \Magento\Framework\Phrase( + \implode(' ', $exceptionMessages) + ) + ); } return true; } + /** + * Delete files recursively + * + * Implemented in order to delete as much files as possible and collect all exceptions + * + * @param string $path + * @return void + * @throws FileSystemException + */ + private function deleteFilesRecursively(string $path) + { + $exceptionMessages = []; + $entitiesList = $this->driver->readDirectoryRecursively($path); + foreach ($entitiesList as $entityPath) { + if (!$this->driver->isDirectory($entityPath)) { + try { + $this->driver->deleteFile($entityPath); + } catch (FileSystemException $e) { + $exceptionMessages[] = $e->getMessage(); + } + } + } + if (!empty($exceptionMessages)) { + throw new FileSystemException( + new \Magento\Framework\Phrase( + \implode(' ', $exceptionMessages) + ) + ); + } + } + /** * Change permissions of given path * diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index b54b02bd6de98..e8d51f52ff153 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -399,16 +399,28 @@ public function deleteFile($path) */ public function deleteDirectory($path) { + $exceptionMessages = []; $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; $iterator = new \FilesystemIterator($path, $flags); /** @var \FilesystemIterator $entity */ foreach ($iterator as $entity) { if ($entity->isDir()) { - $this->deleteDirectory($entity->getPathname()); + try { + $this->deleteDirectory($entity->getPathname()); + } catch (FileSystemException $exception) { + $exceptionMessages[] = $exception->getMessage(); + } } else { $this->deleteFile($entity->getPathname()); } } + if (!empty($exceptionMessages)) { + throw new FileSystemException( + new \Magento\Framework\Phrase( + \implode(' ', $exceptionMessages) + ) + ); + } $result = @rmdir($this->getScheme() . $path); if (!$result) { throw new FileSystemException( From a14244e86c129f1296e5f5b0b2a0fac86e5fb526 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 24 Oct 2018 11:51:40 +0300 Subject: [PATCH 07/89] MAGETWO-95853: Can't flush Images cache in admin --- lib/internal/Magento/Framework/Filesystem/Directory/Write.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php index 74314b747cf42..cb8f6dd0b88e0 100644 --- a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php +++ b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php @@ -215,7 +215,7 @@ private function deleteFilesRecursively(string $path) $exceptionMessages = []; $entitiesList = $this->driver->readDirectoryRecursively($path); foreach ($entitiesList as $entityPath) { - if (!$this->driver->isDirectory($entityPath)) { + if ($this->driver->isFile($entityPath)) { try { $this->driver->deleteFile($entityPath); } catch (FileSystemException $e) { From 7e74d4ee5ee682926044e4c8f153437c768e62d8 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 24 Oct 2018 12:55:47 +0300 Subject: [PATCH 08/89] MAGETWO-95853: Can't flush Images cache in admin --- .../Magento/Framework/Filesystem/Directory/Write.php | 5 ++++- lib/internal/Magento/Framework/Filesystem/Driver/File.php | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php index cb8f6dd0b88e0..88c03f7869581 100644 --- a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php +++ b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php @@ -9,6 +9,9 @@ use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\ValidatorException; +/** + * Write Interface implementation + */ class Write extends Read implements WriteInterface { /** @@ -289,7 +292,7 @@ public function touch($path, $modificationTime = null) /** * Check if given path is writable * - * @param null $path + * @param string|null $path * @return bool * @throws \Magento\Framework\Exception\FileSystemException * @throws ValidatorException diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index e8d51f52ff153..395144ca6ee7d 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -14,6 +14,7 @@ /** * Class File + * * @package Magento\Framework\Filesystem\Driver * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ @@ -855,6 +856,8 @@ public function fileUnlock($resource) } /** + * Retrieves absolute path + * * @param string $basePath * @param string $path * @param string|null $scheme From ea180c8940a7e5da139feee9770e943cefdb96b3 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 24 Oct 2018 13:04:23 +0300 Subject: [PATCH 09/89] MAGETWO-95853: Can't flush Images cache in admin --- lib/internal/Magento/Framework/Filesystem/Driver/File.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index 395144ca6ee7d..4ba8f566f3f10 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -895,6 +895,7 @@ public function getRelativePath($basePath, $path = null) /** * Fixes path separator + * * Utility method. * * @param string $path From 8248518ce4988324fd1e6224eb79f39d211cf41a Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 24 Oct 2018 17:25:21 +0300 Subject: [PATCH 10/89] MAGETWO-95853: Can't flush Images cache in admin --- .../Framework/Filesystem/Directory/Write.php | 14 +++++++------- .../Magento/Framework/Filesystem/Driver/File.php | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php index 88c03f7869581..e4b52de49d5f9 100644 --- a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php +++ b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php @@ -193,13 +193,13 @@ public function delete($path = null) } catch (FileSystemException $e) { $exceptionMessages[] = $e->getMessage(); } - } - if (!empty($exceptionMessages)) { - throw new FileSystemException( - new \Magento\Framework\Phrase( - \implode(' ', $exceptionMessages) - ) - ); + if (!empty($exceptionMessages)) { + throw new FileSystemException( + new \Magento\Framework\Phrase( + \implode(' ', $exceptionMessages) + ) + ); + } } return true; } diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index 4ba8f566f3f10..f9065e6be6190 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -405,14 +405,14 @@ public function deleteDirectory($path) $iterator = new \FilesystemIterator($path, $flags); /** @var \FilesystemIterator $entity */ foreach ($iterator as $entity) { - if ($entity->isDir()) { - try { + try { + if ($entity->isDir()) { $this->deleteDirectory($entity->getPathname()); - } catch (FileSystemException $exception) { - $exceptionMessages[] = $exception->getMessage(); + } else { + $this->deleteFile($entity->getPathname()); } - } else { - $this->deleteFile($entity->getPathname()); + } catch (FileSystemException $exception) { + $exceptionMessages[] = $exception->getMessage(); } } if (!empty($exceptionMessages)) { From c05cbea7b6df8620b9a2ee8b97cb1dbcff7b4b79 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 24 Oct 2018 17:44:29 +0300 Subject: [PATCH 11/89] MAGETWO-95853: Can't flush Images cache in admin --- .../Magento/Framework/Filesystem/Directory/Write.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php index e4b52de49d5f9..3c6d2b7321b82 100644 --- a/lib/internal/Magento/Framework/Filesystem/Directory/Write.php +++ b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php @@ -189,10 +189,15 @@ public function delete($path = null) } else { try { $this->deleteFilesRecursively($absolutePath); + } catch (FileSystemException $e) { + $exceptionMessages[] = $e->getMessage(); + } + try { $this->driver->deleteDirectory($absolutePath); } catch (FileSystemException $e) { $exceptionMessages[] = $e->getMessage(); } + if (!empty($exceptionMessages)) { throw new FileSystemException( new \Magento\Framework\Phrase( From bf0030fbbd49ce1c40a17bd1f0717a9dffeb326d Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 25 Oct 2018 13:12:00 +0530 Subject: [PATCH 12/89] Update blocks --- app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php | 5 ++++- .../Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php b/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php index 962127e16f716..d7c0008c7d927 100644 --- a/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php +++ b/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php @@ -78,7 +78,10 @@ private function getBlocksData(array $blockIdentifiers): array $blocksData = []; try { foreach ($blockIdentifiers as $blockIdentifier) { - $blocksData[$blockIdentifier] = $this->blockDataProvider->getData($blockIdentifier); + $blockData = $this->blockDataProvider->getData($blockIdentifier); + if (!empty($blockData)) { + $blocksData[$blockIdentifier] = $blockData; + } } } catch (NoSuchEntityException $e) { throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e); diff --git a/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php b/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php index 5b7e632a73cb0..d47a0dca27157 100644 --- a/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php +++ b/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php @@ -49,7 +49,7 @@ public function getData(string $blockIdentifier): array $block = $this->blockRepository->getById($blockIdentifier); if (false === $block->isActive()) { - throw new NoSuchEntityException(); + return []; } $renderedContent = $this->widgetFilter->filter($block->getContent()); From 4eac0fce975759e961793d88c77d35f61bd9d94e Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 26 Oct 2018 13:06:44 +0530 Subject: [PATCH 13/89] Added warning log --- .../Magento/CmsGraphQl/Model/Resolver/Blocks.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php b/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php index d7c0008c7d927..fabb479763e60 100644 --- a/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php +++ b/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php @@ -14,6 +14,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Psr\Log\LoggerInterface; /** * CMS blocks field resolver, used for GraphQL request processing @@ -25,13 +26,20 @@ class Blocks implements ResolverInterface */ private $blockDataProvider; + /** + * @var LoggerInterface + */ + private $logger; + /** * @param BlockDataProvider $blockDataProvider */ public function __construct( - BlockDataProvider $blockDataProvider + BlockDataProvider $blockDataProvider, + LoggerInterface $logger ) { $this->blockDataProvider = $blockDataProvider; + $this->logger = $logger; } /** @@ -81,6 +89,10 @@ private function getBlocksData(array $blockIdentifiers): array $blockData = $this->blockDataProvider->getData($blockIdentifier); if (!empty($blockData)) { $blocksData[$blockIdentifier] = $blockData; + } else { + $this->logger->warning( + sprintf('The CMS block with the "%s" Identifier is disabled.', $blockIdentifier) + ); } } } catch (NoSuchEntityException $e) { From cd243969b796e658edd844a3fe91d43cb308f72a Mon Sep 17 00:00:00 2001 From: saphal Date: Sat, 27 Oct 2018 15:42:40 +0530 Subject: [PATCH 14/89] #18192, Fixed rating issue website wise --- .../Review/Model/ResourceModel/Rating.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 3f54c17f6ff7c..5232a7fa33af4 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -34,12 +34,18 @@ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ protected $_logger; + /** + * @var \Magento\Framework\App\State + */ + protected $_state; + /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\ResourceModel\Review\Summary $reviewSummary + * @param \Magento\Framework\App\State * @param string $connectionName */ public function __construct( @@ -48,12 +54,14 @@ public function __construct( \Magento\Framework\Module\Manager $moduleManager, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Review\Model\ResourceModel\Review\Summary $reviewSummary, + \Magento\Framework\App\State $state, $connectionName = null ) { $this->moduleManager = $moduleManager; $this->_storeManager = $storeManager; $this->_logger = $logger; $this->_reviewSummary = $reviewSummary; + $this->_state = $state; parent::__construct($context, $connectionName); } @@ -425,9 +433,15 @@ public function getReviewSummary($object, $onlyForCurrentStore = true) $data = $connection->fetchAll($select, [':review_id' => $object->getReviewId()]); + if ($this->_state->getAreaCode() == "adminhtml") { + $currentStore = false; + } else { + $currentStore = $this->_storeManager->getStore()->setId(); + } + if ($onlyForCurrentStore) { foreach ($data as $row) { - if ($row['store_id'] == $this->_storeManager->getStore()->getId()) { + if ($row['store_id'] == $currentStore) { $object->addData($row); } } From cbbaf120f228d4499bdb7ead40a26f6a2f1c2330 Mon Sep 17 00:00:00 2001 From: saphal Date: Sat, 27 Oct 2018 18:51:56 +0530 Subject: [PATCH 15/89] updated code as per given instruction --- app/code/Magento/Review/Model/ResourceModel/Rating.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 5232a7fa33af4..79609a9afe41f 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -433,10 +433,9 @@ public function getReviewSummary($object, $onlyForCurrentStore = true) $data = $connection->fetchAll($select, [':review_id' => $object->getReviewId()]); + $currentStore = $this->_storeManager->getStore()->setId(); if ($this->_state->getAreaCode() == "adminhtml") { $currentStore = false; - } else { - $currentStore = $this->_storeManager->getStore()->setId(); } if ($onlyForCurrentStore) { From b0240f1588f6e4458a59d01e70c5d8d51d98aca4 Mon Sep 17 00:00:00 2001 From: Denis Papec Date: Sun, 28 Oct 2018 20:04:33 +0000 Subject: [PATCH 16/89] Clean Up Magento/ImportExport/Controller/Adminhtml/History/Download --- .../ImportExport/Controller/Adminhtml/History/Download.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php b/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php index e490ee4018376..4dda5ebc4a310 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php @@ -15,6 +15,11 @@ class Download extends \Magento\ImportExport\Controller\Adminhtml\History */ protected $resultRawFactory; + /** + * @var \Magento\Framework\App\Response\Http\FileFactory + */ + private $fileFactory; + /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory From 611969d9a56905613aefb981c8cd4be7efc24330 Mon Sep 17 00:00:00 2001 From: saphal Date: Mon, 29 Oct 2018 11:04:31 +0530 Subject: [PATCH 17/89] code modification --- app/code/Magento/Review/Model/ResourceModel/Rating.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 79609a9afe41f..debaf61c4dd4b 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -433,10 +433,7 @@ public function getReviewSummary($object, $onlyForCurrentStore = true) $data = $connection->fetchAll($select, [':review_id' => $object->getReviewId()]); - $currentStore = $this->_storeManager->getStore()->setId(); - if ($this->_state->getAreaCode() == "adminhtml") { - $currentStore = false; - } + $currentStore = ($this->_state->getAreaCode() == "adminhtml") ? false : $this->_storeManager->getStore()->getId(); if ($onlyForCurrentStore) { foreach ($data as $row) { From 774164c2ae589e45fd3bdfcf09a6de4c6b0cba1a Mon Sep 17 00:00:00 2001 From: saphal Date: Tue, 30 Oct 2018 11:30:19 +0530 Subject: [PATCH 18/89] core modified as per instructions --- .../Magento/Review/Model/ResourceModel/Rating.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index debaf61c4dd4b..df138ed8173be 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -34,18 +34,12 @@ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ protected $_logger; - /** - * @var \Magento\Framework\App\State - */ - protected $_state; - /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\ResourceModel\Review\Summary $reviewSummary - * @param \Magento\Framework\App\State * @param string $connectionName */ public function __construct( @@ -54,14 +48,12 @@ public function __construct( \Magento\Framework\Module\Manager $moduleManager, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Review\Model\ResourceModel\Review\Summary $reviewSummary, - \Magento\Framework\App\State $state, $connectionName = null ) { $this->moduleManager = $moduleManager; $this->_storeManager = $storeManager; $this->_logger = $logger; $this->_reviewSummary = $reviewSummary; - $this->_state = $state; parent::__construct($context, $connectionName); } @@ -433,11 +425,11 @@ public function getReviewSummary($object, $onlyForCurrentStore = true) $data = $connection->fetchAll($select, [':review_id' => $object->getReviewId()]); - $currentStore = ($this->_state->getAreaCode() == "adminhtml") ? false : $this->_storeManager->getStore()->getId(); + $currentStore = ($this->_storeManager->isSingleStoreMode()) ? $this->_storeManager->getStore()->getId() : NULL ; if ($onlyForCurrentStore) { foreach ($data as $row) { - if ($row['store_id'] == $currentStore) { + if (!$row['store_id'] == NULL) { $object->addData($row); } } From 2ea37a87e250209d28d92b0987daddf068cfaf9c Mon Sep 17 00:00:00 2001 From: saphal Date: Tue, 30 Oct 2018 12:13:38 +0530 Subject: [PATCH 19/89] updated code --- app/code/Magento/Review/Model/ResourceModel/Rating.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index df138ed8173be..77a9727bd849e 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -429,7 +429,7 @@ public function getReviewSummary($object, $onlyForCurrentStore = true) if ($onlyForCurrentStore) { foreach ($data as $row) { - if (!$row['store_id'] == NULL) { + if (!$row['store_id'] == $currentStore) { $object->addData($row); } } From 970a746e1274419973be563ffd8e3a49a8cb26ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 21:13:56 +0200 Subject: [PATCH 20/89] Update _module.less code clean up --- .../Magento_MultipleWishlist/web/css/source/_module.less | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less index 145dc10263fb1..cb341f3f479ba 100644 --- a/app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less @@ -185,7 +185,7 @@ } .form-wishlist-search { - .lib-css(margin-bottom, @indent__l*2); + margin-bottom: @indent__l * 2; max-width: 500px; .fieldset { @@ -216,8 +216,9 @@ .block-wishlist-info-items { .block-title { - .lib-css(margin-bottom, @indent__base); .lib-font-size(22); + margin-bottom: @indent__base; + > strong { font-weight: @font-weight__light; } From c7aa2f7def099baefda795e3ff64ea26e8ce1d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 21:24:33 +0200 Subject: [PATCH 21/89] Update _module.less --- .../Magento_MultipleWishlist/web/css/source/_module.less | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_MultipleWishlist/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_MultipleWishlist/web/css/source/_module.less index 6ab7a8e47a174..0b01c54a64378 100644 --- a/app/design/frontend/Magento/luma/Magento_MultipleWishlist/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_MultipleWishlist/web/css/source/_module.less @@ -40,6 +40,7 @@ .items { padding: 6px 0; text-align: left; + .item { > span { display: block; @@ -47,6 +48,7 @@ } } + li { padding: 0; } @@ -115,6 +117,7 @@ &.split, &.toggle { .lib-css(color, @link__color); + &:before { display: none; } @@ -135,6 +138,7 @@ &.overlay { .lib-window-overlay(); + &.active { display: block; } @@ -254,7 +258,7 @@ } .form-wishlist-search { - .lib-css(margin-bottom, @indent__l*2); + margin-bottom: @indent__l * 2; max-width: 500px; .fieldset { @@ -281,7 +285,7 @@ .block-wishlist-info-items { .block-title { - .lib-css(margin-bottom, @indent__base); + margin-bottom: @indent__base; .lib-font-size(22px); > strong { @@ -352,6 +356,7 @@ // Select wish list &-select { margin: 0 -@layout__width-xs-indent 20px; + .wishlist-name { .lib-font-size(16); &:extend(.abs-toggling-title-mobile all); From b0fca1d57b6b9352e62f8059e58f5d62bf8c45d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 21:31:16 +0200 Subject: [PATCH 22/89] Update _widgets.less --- .../Magento/blank/Magento_Banner/web/css/source/_widgets.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Banner/web/css/source/_widgets.less b/app/design/frontend/Magento/blank/Magento_Banner/web/css/source/_widgets.less index 80ac77e42fc04..c961d49c5b589 100644 --- a/app/design/frontend/Magento/blank/Magento_Banner/web/css/source/_widgets.less +++ b/app/design/frontend/Magento/blank/Magento_Banner/web/css/source/_widgets.less @@ -8,7 +8,6 @@ // _____________________________________________ & when (@media-common = true) { - .block-banners, .block-banners-inline { &:extend(.abs-margin-for-blocks-and-widgets); @@ -22,7 +21,7 @@ } .banner-item-content { - .lib-css(margin-bottom, @indent__base); + margin-bottom: @indent__base; img { display: block; From b198d34bda628bc022bef79767cacbb075c1d62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 21:37:50 +0200 Subject: [PATCH 23/89] Update _minicart.less --- .../web/css/source/module/_minicart.less | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less index 7bd27106b67d9..2219db1cf694d 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less @@ -125,7 +125,7 @@ float: right; .block-minicart { - .lib-css(padding, 25px @minicart__padding-horizontal); + padding: 25px @minicart__padding-horizontal; .block-title { display: none; @@ -148,10 +148,10 @@ .action { &.close { .lib-button-icon( - @icon-remove, - @_icon-font-size: 32px, - @_icon-font-line-height: 32px, - @_icon-font-text-hide: true + @icon-remove, + @_icon-font-size: 32px, + @_icon-font-line-height: 32px, + @_icon-font-text-hide: true ); .lib-button-reset(); height: 40px; @@ -205,8 +205,8 @@ } .minicart-items-wrapper { - .lib-css(border, 1px solid @minicart__border-color); - .lib-css(margin, 0 -@minicart__padding-horizontal); + border: 1px solid @minicart__border-color; + margin: 0 -@minicart__padding-horizontal; border-left: 0; border-right: 0; overflow-x: auto; @@ -220,7 +220,7 @@ padding: @indent__base 0; &:not(:first-child) { - .lib-css(border-top, 1px solid @minicart__border-color); + border-top: 1px solid @minicart__border-color; } &:first-child { @@ -254,12 +254,12 @@ .toggle { .lib-icon-font( - @_icon-font-content: @icon-down, - @_icon-font-size: 28px, - @_icon-font-line-height: 16px, - @_icon-font-text-hide: false, - @_icon-font-position: after, - @_icon-font-display: block + @_icon-font-content: @icon-down, + @_icon-font-size: 28px, + @_icon-font-line-height: 16px, + @_icon-font-text-hide: false, + @_icon-font-position: after, + @_icon-font-display: block ); cursor: pointer; position: relative; @@ -274,8 +274,8 @@ &.active { > .toggle { .lib-icon-font-symbol( - @_icon-font-content: @icon-up, - @_icon-font-position: after + @_icon-font-content: @icon-up, + @_icon-font-position: after ); } } @@ -304,6 +304,7 @@ .weee[data-label] { .lib-font-size(11); + .label { &:extend(.abs-no-display all); } @@ -317,12 +318,12 @@ .product.options { .tooltip.toggle { .lib-icon-font( - @icon-down, - @_icon-font-size: 28px, - @_icon-font-line-height: 28px, - @_icon-font-text-hide: true, - @_icon-font-margin: -3px 0 0 7px, - @_icon-font-position: after + @icon-down, + @_icon-font-size: 28px, + @_icon-font-line-height: 28px, + @_icon-font-text-hide: true, + @_icon-font-margin: -3px 0 0 7px, + @_icon-font-position: after ); .details { @@ -357,19 +358,19 @@ &.edit, &.delete { .lib-icon-font( - @icon-settings, - @_icon-font-size: 28px, - @_icon-font-line-height: 28px, - @_icon-font-text-hide: true, - @_icon-font-color: @color-gray19, - @_icon-font-color-hover: @color-gray19, - @_icon-font-color-active: @color-gray19 + @icon-settings, + @_icon-font-size: 28px, + @_icon-font-line-height: 28px, + @_icon-font-text-hide: true, + @_icon-font-color: @color-gray19, + @_icon-font-color-hover: @color-gray19, + @_icon-font-color-active: @color-gray19 ); } &.delete { .lib-icon-font-symbol( - @_icon-font-content: @icon-trash + @_icon-font-content: @icon-trash ); } } @@ -399,6 +400,7 @@ .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { .minicart-wrapper { margin-left: 13px; + .block-minicart { right: -15px; width: 390px; From b48b95f0c6027e7bf93ce49297c4cb04b567b577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 21:42:18 +0200 Subject: [PATCH 24/89] Update _minicart.less --- .../web/css/source/module/_minicart.less | 77 ++++++++++--------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index 03e4bfff3ba9c..14db9dd868e00 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -107,28 +107,28 @@ .minicart-wrapper { .lib-dropdown( - @_toggle-selector: ~'.action.showcart', - @_options-selector: ~'.block-minicart', - @_dropdown-list-width: 320px, - @_dropdown-list-position-right: 0px, - @_dropdown-list-pointer-position: right, - @_dropdown-list-pointer-position-left-right: 26px, - @_dropdown-list-z-index: 101, - @_dropdown-toggle-icon-content: @icon-cart, - @_dropdown-toggle-active-icon-content: @icon-cart, - @_dropdown-list-item-padding: false, - @_dropdown-list-item-hover: false, - @_icon-font-position: before, - @_icon-font-size: 22px, - @_icon-font-line-height: 28px, - @_icon-font-color: @minicart-icons-color, - @_icon-font-color-hover: @minicart-icons-color-hover, - @_icon-font-color-active: @minicart-icons-color + @_toggle-selector: ~'.action.showcart', + @_options-selector: ~'.block-minicart', + @_dropdown-list-width: 320px, + @_dropdown-list-position-right: 0px, + @_dropdown-list-pointer-position: right, + @_dropdown-list-pointer-position-left-right: 26px, + @_dropdown-list-z-index: 101, + @_dropdown-toggle-icon-content: @icon-cart, + @_dropdown-toggle-active-icon-content: @icon-cart, + @_dropdown-list-item-padding: false, + @_dropdown-list-item-hover: false, + @_icon-font-position: before, + @_icon-font-size: 22px, + @_icon-font-line-height: 28px, + @_icon-font-color: @minicart-icons-color, + @_icon-font-color-hover: @minicart-icons-color-hover, + @_icon-font-color-active: @minicart-icons-color ); float: right; .block-minicart { - .lib-css(padding, 25px @minicart__padding-horizontal); + padding: 25px @minicart__padding-horizontal; .block-title { display: none; @@ -216,8 +216,8 @@ } .minicart-items-wrapper { - .lib-css(border, 1px solid @minicart__border-color); - .lib-css(margin, 0 -@minicart__padding-horizontal); + border: 1px solid @minicart__border-color; + margin: 0 -@minicart__padding-horizontal; border-left: 0; border-right: 0; overflow-x: auto; @@ -226,11 +226,12 @@ .minicart-items { .lib-list-reset-styles(); + .product-item { padding: @indent__base 0; &:not(:first-child) { - .lib-css(border-top, 1px solid @minicart__border-color); + border-top: 1px solid @minicart__border-color; } &:first-child { @@ -297,13 +298,14 @@ .toggle { &:extend(.abs-toggling-title all); + border: 0; + padding: 0 @indent__xl @indent__xs 0; + &:after { .lib-css(color, @color-gray56); margin: 0 0 0 @indent__xs; position: static; } - border: 0; - padding: 0 @indent__xl @indent__xs 0; } .active { @@ -323,14 +325,15 @@ .toggle { &.tooltip { .lib-icon-font( - @icon-down, - @_icon-font-size: 12px, - @_icon-font-line-height: 12px, - @_icon-font-text-hide: true, - @_icon-font-margin: -3px 0 0 7px, - @_icon-font-position: after + @icon-down, + @_icon-font-size: 12px, + @_icon-font-line-height: 12px, + @_icon-font-text-hide: true, + @_icon-font-margin: -3px 0 0 7px, + @_icon-font-position: after ); } + > span { &:extend(.abs-visually-hidden-reset all); } @@ -368,19 +371,19 @@ &.edit, &.delete { .lib-icon-font( - @icon-edit, - @_icon-font-size: 18px, - @_icon-font-line-height: 20px, - @_icon-font-text-hide: true, - @_icon-font-color: @minicart-icons-color, - @_icon-font-color-hover: @primary__color, - @_icon-font-color-active: @minicart-icons-color + @icon-edit, + @_icon-font-size: 18px, + @_icon-font-line-height: 20px, + @_icon-font-text-hide: true, + @_icon-font-color: @minicart-icons-color, + @_icon-font-color-hover: @primary__color, + @_icon-font-color-active: @minicart-icons-color ); } &.delete { .lib-icon-font-symbol( - @_icon-font-content: @icon-trash + @_icon-font-content: @icon-trash ); } } From ecaabe44f4264d90a63c3fb3624bb04e47f9e661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 21:50:39 +0200 Subject: [PATCH 25/89] Update _module.less --- .../Magento_Review/web/css/source/_module.less | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Review/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Review/web/css/source/_module.less index 7d5b79bc5a091..69ec01d71e104 100644 --- a/app/design/frontend/Magento/blank/Magento_Review/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_Review/web/css/source/_module.less @@ -15,9 +15,9 @@ // _____________________________________________ & when (@media-common = true) { - .rating-summary { .lib-rating-summary(); + .rating-result { margin-left: -5px; } @@ -165,10 +165,10 @@ .review-details { .customer-review-rating { - .lib-css(margin-bottom, @indent__base); + margin-bottom: @indent__base; .item { - .lib-css(margin-bottom, @indent__s); + margin-bottom: @indent__s; &:last-child { margin-bottom: 0; @@ -178,12 +178,12 @@ .review-title { .lib-heading(h3); - .lib-css(font-weight, @font-weight__semibold); - .lib-css(margin-bottom, @indent__base); + font-weight: @font-weight__semibold; + margin-bottom: @indent__base; } .review-content { - .lib-css(margin-bottom, @indent__base); + margin-bottom: @indent__base; } } @@ -271,7 +271,7 @@ &-field-rating { .control { - margin-bottom: 1.2*@indent__xl; + margin-bottom: 1.2 * @indent__xl; margin-top: @indent__s; } } From a02c49ffeddd25852bc6bb2b5709c513c946c5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 21:56:32 +0200 Subject: [PATCH 26/89] Update _module.less --- .../web/css/source/_module.less | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less index da78406f92212..2c66420f65fbd 100644 --- a/app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less @@ -14,7 +14,6 @@ // _____________________________________________ & when (@media-common = true) { - .data.switch .counter { .lib-css(color, @text__color__muted); @@ -118,13 +117,13 @@ strong { display: block; - font-weight: 600; + font-weight: @font-weight__semibold; } } .fieldset &-field-ratings { > .label { - font-weight: 600; + font-weight: @font-weight__semibold; margin-bottom: @indent__s; padding: 0; } @@ -140,11 +139,11 @@ &-field-rating { .label { - font-weight: 600; + font-weight: @font-weight__semibold; } .control { - margin-bottom: 1.2*@indent__xl; + margin-bottom: 1.2 * @indent__xl; margin-top: @indent__s; } } @@ -181,7 +180,7 @@ display: inline; .review-details-value { - font-weight: 400; + font-weight: @font-weight__regular; } } @@ -341,7 +340,7 @@ .block-reviews-dashboard { .items { .item { - .lib-css(margin-bottom, @indent__base); + margin-bottom: @indent__base; &:last-child { margin-bottom: 0; @@ -353,14 +352,14 @@ display: inline-block; &:not(:last-child) { - .lib-css(margin-bottom, @indent__xs); + margin-bottom: @indent__xs; } } .rating-summary { .label { - .lib-css(font-weight, @font-weight__semibold); - .lib-css(margin-right, @indent__s); + font-weight: @font-weight__semibold; + margin-right: @indent__s; } } } @@ -368,7 +367,7 @@ .table-reviews, .block-reviews-dashboard { .product-name { - .lib-css(font-weight, @font-weight__regular); + font-weight: @font-weight__regular; } } @@ -416,6 +415,7 @@ .product-details { &:extend(.abs-add-clearfix all); &:extend(.abs-margin-for-blocks-and-widgets all); + .rating-average-label { &:extend(.abs-visually-hidden all); } @@ -436,9 +436,10 @@ } .customer-review-rating { - .lib-css(margin-bottom, @indent__base); + margin-bottom: @indent__base; + .item { - .lib-css(margin-bottom, @indent__s); + margin-bottom: @indent__s; &:last-child { margin-bottom: 0; @@ -450,13 +451,13 @@ .review-title { .lib-heading(h3); - .lib-css(font-weight, @font-weight__semibold); - .lib-css(margin-bottom, @indent__base); + font-weight: @font-weight__semibold; + margin-bottom: @indent__base; } .review-content { margin: 0; - .lib-css(margin-bottom, @indent__base); + margin-bottom: @indent__base; } .review-date { @@ -473,13 +474,13 @@ .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) { .customer-review { .product-name { - .lib-css(margin-bottom, @indent__xs); + margin-bottom: @indent__xs; } .product-reviews-summary { .rating-summary { display: block; - .lib-css(margin-bottom, @indent__xs); + margin-bottom: @indent__xs; } } } From 59a88f3509bba27c988fc89f874cdaf7f0d5c29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 22:08:34 +0200 Subject: [PATCH 27/89] Update _extends.less --- .../blank/web/css/source/_extends.less | 191 +++++++++--------- 1 file changed, 96 insertions(+), 95 deletions(-) diff --git a/app/design/frontend/Magento/blank/web/css/source/_extends.less b/app/design/frontend/Magento/blank/web/css/source/_extends.less index 13da4a4d996cc..4b328ab1015ed 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_extends.less +++ b/app/design/frontend/Magento/blank/web/css/source/_extends.less @@ -162,7 +162,7 @@ & when (@media-common = true) { .abs-login-block-title { strong { - font-weight: 500; + font-weight: @font-weight__heavier; } .lib-font-size(18); @@ -178,11 +178,11 @@ & when (@media-common = true) { .abs-block-title { + margin-bottom: 15px; + > strong { .lib-heading(h3); } - - margin-bottom: 15px; } } @@ -194,6 +194,7 @@ .abs-account-blocks { .block-title { &:extend(.abs-block-title all); + > .action { margin-left: 15px; } @@ -208,7 +209,7 @@ } > .action { - font-weight: 400; + font-weight: @font-weight__regular; margin-left: @indent__s; } } @@ -232,10 +233,10 @@ & when (@media-common = true) { .abs-dropdown-simple { .lib-dropdown( - @_dropdown-list-item-padding: 5px 5px 5px 23px, - @_dropdown-list-min-width: 200px, - @_icon-font-margin: 0 0 0 5px, - @_icon-font-vertical-align: middle + @_dropdown-list-item-padding: 5px 5px 5px 23px, + @_dropdown-list-min-width: 200px, + @_icon-font-margin: 0 0 0 5px, + @_icon-font-vertical-align: middle ); } } @@ -268,13 +269,13 @@ & when (@media-common = true) { .abs-remove-button-for-blocks { .lib-icon-font( - @icon-remove, - @_icon-font-size: 26px, - @_icon-font-line-height: 15px, - @_icon-font-text-hide: true, - @_icon-font-color: @color-gray19, - @_icon-font-color-hover: @color-gray19, - @_icon-font-color-active: @color-gray19 + @icon-remove, + @_icon-font-size: 26px, + @_icon-font-line-height: 15px, + @_icon-font-text-hide: true, + @_icon-font-color: @color-gray19, + @_icon-font-color-hover: @color-gray19, + @_icon-font-color-active: @color-gray19 ); } } @@ -289,14 +290,14 @@ > a { .lib-link( - @_link-color: @product-name-link__color, - @_link-text-decoration: @product-name-link__text-decoration, - @_link-color-visited: @product-name-link__color__visited, - @_link-text-decoration-visited: @product-name-link__text-decoration__visited, - @_link-color-hover: @product-name-link__color__hover, - @_link-text-decoration-hover: @product-name-link__text-decoration__hover, - @_link-color-active: @product-name-link__color__active, - @_link-text-decoration-active: @product-name-link__text-decoration__active + @_link-color: @product-name-link__color, + @_link-text-decoration: @product-name-link__text-decoration, + @_link-color-visited: @product-name-link__color__visited, + @_link-text-decoration-visited: @product-name-link__text-decoration__visited, + @_link-color-hover: @product-name-link__color__hover, + @_link-text-decoration-hover: @product-name-link__text-decoration__hover, + @_link-color-active: @product-name-link__color__active, + @_link-text-decoration-active: @product-name-link__text-decoration__active ); } } @@ -613,11 +614,11 @@ & when (@media-common = true) { .abs-navigation-icon { .lib-icon-font( - @_icon-font-content: @icon-down, - @_icon-font-size: 34px, - @_icon-font-line-height: 1.2, - @_icon-font-position: after, - @_icon-font-display: block + @_icon-font-content: @icon-down, + @_icon-font-size: 34px, + @_icon-font-line-height: 1.2, + @_icon-font-position: after, + @_icon-font-display: block ); &:after { @@ -635,8 +636,8 @@ & when (@media-common = true) { .abs-split-button { .lib-dropdown-split( - @_options-selector : ~'.items', - @_dropdown-split-button-border-radius-fix: true + @_options-selector : ~'.items', + @_dropdown-split-button-border-radius-fix: true ); vertical-align: middle; } @@ -654,13 +655,13 @@ .abs-actions-addto-gridlist { .lib-icon-font( - @_icon-font-content: '', - @_icon-font-size: 29px, - @_icon-font-color: @addto-color, - @_icon-font-color-hover: @addto-hover-color, - @_icon-font-text-hide: true, - @_icon-font-vertical-align: middle, - @_icon-font-line-height: 24px + @_icon-font-content: '', + @_icon-font-size: 29px, + @_icon-font-color: @addto-color, + @_icon-font-color-hover: @addto-hover-color, + @_icon-font-text-hide: true, + @_icon-font-vertical-align: middle, + @_icon-font-line-height: 24px ); } } @@ -762,11 +763,11 @@ padding-right: 12px; position: relative; .lib-icon-font( - @icon-down, - @_icon-font-size: 26px, - @_icon-font-line-height: 10px, - @_icon-font-margin: 3px 0 0 0, - @_icon-font-position: after + @icon-down, + @_icon-font-size: 26px, + @_icon-font-line-height: 10px, + @_icon-font-margin: 3px 0 0 0, + @_icon-font-position: after ); &:after { @@ -777,16 +778,16 @@ &-expanded { .lib-icon-font-symbol( - @_icon-font-content: @icon-up, - @_icon-font-position: after + @_icon-font-content: @icon-up, + @_icon-font-position: after ); } } .abs-tax-total-expanded { .lib-icon-font-symbol( - @_icon-font-content: @icon-up, - @_icon-font-position: after + @_icon-font-content: @icon-up, + @_icon-font-position: after ); } } @@ -867,10 +868,10 @@ & when (@media-common = true) { .abs-icon-add { .lib-icon-font( - @_icon-font-content: @icon-expand, - @_icon-font-size: 10px, - @_icon-font-line-height: 10px, - @_icon-font-vertical-align: middle + @_icon-font-content: @icon-expand, + @_icon-font-size: 10px, + @_icon-font-line-height: 10px, + @_icon-font-vertical-align: middle ); } } @@ -878,12 +879,12 @@ .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) { .abs-icon-add-mobile { .lib-icon-font( - @_icon-font-content: @icon-expand, - @_icon-font-size: 10px, - @_icon-font-line-height: 10px, - @_icon-font-vertical-align: middle, - @_icon-font-margin: 0 5px 0 0, - @_icon-font-display: block + @_icon-font-content: @icon-expand, + @_icon-font-size: 10px, + @_icon-font-line-height: 10px, + @_icon-font-vertical-align: middle, + @_icon-font-margin: 0 5px 0 0, + @_icon-font-display: block ); } } @@ -924,11 +925,11 @@ position: relative; .lib-icon-font( - @_icon-font-content: @icon-down, - @_icon-font-size: 28px, - @_icon-font-text-hide: false, - @_icon-font-position: after, - @_icon-font-display: block + @_icon-font-content: @icon-down, + @_icon-font-size: 28px, + @_icon-font-text-hide: false, + @_icon-font-position: after, + @_icon-font-display: block ); &:after { @@ -1068,12 +1069,12 @@ font-weight: @font-weight__bold; .lib-link-as-button(); .lib-button( - @_button-padding: 7px 15px 7px 0, - @_button-icon-use: true, - @_button-font-content: @icon-prev, - @_button-icon-font-size: 32px, - @_button-icon-font-line-height: 16px, - @_button-icon-font-position: before + @_button-padding: 7px 15px 7px 0, + @_button-icon-use: true, + @_button-font-content: @icon-prev, + @_button-icon-font-size: 32px, + @_button-icon-font-line-height: 16px, + @_button-icon-font-position: before ); &:active { @@ -1083,9 +1084,9 @@ &.update { .lib-button-icon( - @icon-update, - @_icon-font-size: 32px, - @_icon-font-line-height: 16px + @icon-update, + @_icon-font-size: 32px, + @_icon-font-line-height: 16px ); padding-left: @indent__xs; } @@ -1160,7 +1161,7 @@ & when (@media-common = true) { .abs-field-date-input { - .lib-css(margin-right, @indent__s); + margin-right: @indent__s; width: calc(~'100% -' @icon-calendar__font-size + @indent__s); } } @@ -1175,7 +1176,7 @@ position: relative; input { - .lib-css(margin-right, @indent__s); + margin-right: @indent__s; width: calc(~'100% -' @checkout-tooltip-icon__font-size + @indent__s + @indent__xs); } } @@ -1193,12 +1194,12 @@ &:before, &:after { .lib-arrow( - @_position: top, - @_size: @checkout-tooltip-icon-arrow__font-size, - @_color: @checkout-tooltip-content__background-color + @_position: top, + @_size: @checkout-tooltip-icon-arrow__font-size, + @_color: @checkout-tooltip-content__background-color ); .lib-css(margin-top, @checkout-tooltip-icon-arrow__left); - .lib-css(right, @indent__s); + right: @indent__s; left: auto; top: 0; } @@ -1234,11 +1235,11 @@ .lib-css(border-bottom, @checkout-step-title__border); .lib-css(padding-bottom, @checkout-step-title__padding); .lib-typography( - @_font-size: @checkout-step-title__font-size, - @_font-weight: @checkout-step-title__font-weight, - @_font-family: false, - @_font-style: false, - @_line-height: false + @_font-size: @checkout-step-title__font-size, + @_font-weight: @checkout-step-title__font-weight, + @_font-family: false, + @_font-style: false, + @_line-height: false ); } } @@ -1299,11 +1300,11 @@ .amount .price { .lib-icon-font( - @icon-down, - @_icon-font-size: 30px, - @_icon-font-text-hide: true, - @_icon-font-position: after, - @_icon-font-display: block + @icon-down, + @_icon-font-size: 30px, + @_icon-font-text-hide: true, + @_icon-font-position: after, + @_icon-font-display: block ); padding-right: @indent__m; position: relative; @@ -1323,8 +1324,8 @@ .amount .price { .lib-icon-font-symbol( - @_icon-font-content: @icon-up, - @_icon-font-position: after + @_icon-font-content: @icon-up, + @_icon-font-position: after ); } } @@ -1332,7 +1333,7 @@ &-details { display: none; - .lib-css(border-bottom, @border-width__base solid @border-color__base); + border-bottom: @border-width__base solid @border-color__base; &.shown { display: table-row; @@ -1357,10 +1358,10 @@ cursor: pointer; font-weight: @font-weight__semibold; .lib-icon-font( - @_icon-font-content: @icon-down, - @_icon-font-size: 30px, - @_icon-font-position: after, - @_icon-font-display: block + @_icon-font-content: @icon-down, + @_icon-font-size: 30px, + @_icon-font-position: after, + @_icon-font-display: block ); margin-bottom: 0; overflow: hidden; @@ -1388,8 +1389,8 @@ &.active { > .title { .lib-icon-font-symbol( - @_icon-font-content: @icon-up, - @_icon-font-position: after + @_icon-font-content: @icon-up, + @_icon-font-position: after ); } From 8485195aaee3d02e0d4c3a5a5ed5694dab6ff3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Tue, 30 Oct 2018 22:11:16 +0200 Subject: [PATCH 28/89] Update _toolbar.less --- .../web/css/source/module/_toolbar.less | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module/_toolbar.less b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module/_toolbar.less index aceccb06d47f7..2468d2a3104e4 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module/_toolbar.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module/_toolbar.less @@ -4,14 +4,17 @@ // */ // -// Common -// _____________________________________________ +// Variables +// --------------------------------------------- @toolbar-mode-icon-font-size: 24px; @toolbar-element-background: @panel__background-color; -& when (@media-common = true) { +// +// Common +// _____________________________________________ +& when (@media-common = true) { .page-products { .columns { position: relative; @@ -72,12 +75,12 @@ .sorter-action { vertical-align: top; .lib-icon-font( - @icon-arrow-up, - @_icon-font-size: 28px, - @_icon-font-line-height: 32px, - @_icon-font-color: @header-icons-color, - @_icon-font-color-hover: @header-icons-color-hover, - @_icon-font-text-hide: true + @icon-arrow-up, + @_icon-font-size: 28px, + @_icon-font-line-height: 32px, + @_icon-font-color: @header-icons-color, + @_icon-font-color-hover: @header-icons-color-hover, + @_icon-font-text-hide: true ); } @@ -99,7 +102,7 @@ } .limiter-label { - font-weight: 400; + font-weight: @font-weight__regular; } .limiter { @@ -176,11 +179,11 @@ } .lib-icon-font( - @icon-grid, - @_icon-font-size: @toolbar-mode-icon-font-size, - @_icon-font-text-hide: true, - @_icon-font-color: @text__color__muted, - @_icon-font-color-hover: @text__color__muted + @icon-grid, + @_icon-font-size: @toolbar-mode-icon-font-size, + @_icon-font-text-hide: true, + @_icon-font-color: @text__color__muted, + @_icon-font-color-hover: @text__color__muted ); } From bbc75173ae7ae2b32139714de7616b07da51c845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Wed, 31 Oct 2018 09:06:08 +0200 Subject: [PATCH 29/89] Code clean up --- .../Magento_Checkout/web/css/source/module/_minicart.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less index 2219db1cf694d..d7ff3ba1e5732 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less @@ -125,7 +125,7 @@ float: right; .block-minicart { - padding: 25px @minicart__padding-horizontal; + .lib-css(padding, 25px @minicart__padding-horizontal); .block-title { display: none; @@ -205,8 +205,8 @@ } .minicart-items-wrapper { - border: 1px solid @minicart__border-color; - margin: 0 -@minicart__padding-horizontal; + .lib-css(border, 1px solid @minicart__border-color); + .lib-css(margin, 0 -@minicart__padding-horizontal); border-left: 0; border-right: 0; overflow-x: auto; @@ -220,7 +220,7 @@ padding: @indent__base 0; &:not(:first-child) { - border-top: 1px solid @minicart__border-color; + .lib-css(border-top, 1px solid @minicart__border-color); } &:first-child { From 0d5150ff3edd3544161841076d1f70a7ad8c72b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Wed, 31 Oct 2018 09:09:38 +0200 Subject: [PATCH 30/89] Code clean up --- app/design/frontend/Magento/blank/web/css/source/_extends.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/frontend/Magento/blank/web/css/source/_extends.less b/app/design/frontend/Magento/blank/web/css/source/_extends.less index 4b328ab1015ed..5f24c0db8cc88 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_extends.less +++ b/app/design/frontend/Magento/blank/web/css/source/_extends.less @@ -1332,8 +1332,8 @@ } &-details { + .lib-css(border-bottom, @border-width__base solid @border-color__base); display: none; - border-bottom: @border-width__base solid @border-color__base; &.shown { display: table-row; From 93af83615f677eaa17eab74f9828fb2f8a7db0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Wed, 31 Oct 2018 09:13:02 +0200 Subject: [PATCH 31/89] code clean up --- .../Magento_Checkout/web/css/source/module/_minicart.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index 14db9dd868e00..17fbdc8ba495b 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -128,7 +128,7 @@ float: right; .block-minicart { - padding: 25px @minicart__padding-horizontal; + .lib-css(padding, 25px @minicart__padding-horizontal); .block-title { display: none; @@ -216,8 +216,8 @@ } .minicart-items-wrapper { - border: 1px solid @minicart__border-color; - margin: 0 -@minicart__padding-horizontal; + .lib-css(border, 1px solid @minicart__border-color); + .lib-css(margin, 0 -@minicart__padding-horizontal); border-left: 0; border-right: 0; overflow-x: auto; @@ -231,7 +231,7 @@ padding: @indent__base 0; &:not(:first-child) { - border-top: 1px solid @minicart__border-color; + .lib-css(border-top, 1px solid @minicart__border-color); } &:first-child { From fe82167bb54618ebc7818d5995533f0a55ffdaaa Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Thu, 1 Nov 2018 11:41:26 +0200 Subject: [PATCH 32/89] magento/magento2#17638: [Forwardport]Bundle Special Prices not correctly rounded. --- .../Product/Form/Modifier/Eav.php | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index d84f496e81915..7379600011bcf 100755 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -11,6 +11,7 @@ use Magento\Catalog\Model\Attribute\ScopeOverriddenValue; use Magento\Catalog\Model\Locator\LocatorInterface; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type as ProductType; use Magento\Catalog\Model\ResourceModel\Eav\Attribute as EavAttribute; use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory as EavAttributeFactory; use Magento\Catalog\Ui\DataProvider\CatalogEavValidationRules; @@ -419,7 +420,7 @@ public function modifyData(array $data) foreach ($attributes as $attribute) { if (null !== ($attributeValue = $this->setupAttributeData($attribute))) { - if ($attribute->getFrontendInput() === 'price' && is_scalar($attributeValue)) { + if ($this->isPriceAttribute($attribute, $attributeValue)) { $attributeValue = $this->formatPrice($attributeValue); } $data[$productId][self::DATA_SOURCE_DEFAULT][$attribute->getAttributeCode()] = $attributeValue; @@ -430,6 +431,32 @@ public function modifyData(array $data) return $data; } + /** + * Obtain if given attribute is a price + * + * @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute + * @param string|integer $attributeValue + * @return bool + */ + private function isPriceAttribute(ProductAttributeInterface $attribute, $attributeValue) + { + return $attribute->getFrontendInput() === 'price' + && is_scalar($attributeValue) + && !$this->isBundleSpecialPrice($attribute); + } + + /** + * Obtain if current product is bundle and given attribute is special_price + * + * @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute + * @return bool + */ + private function isBundleSpecialPrice(ProductAttributeInterface $attribute) + { + return $this->locator->getProduct()->getTypeId() === ProductType::TYPE_BUNDLE + && $attribute->getAttributeCode() === ProductAttributeInterface::CODE_SPECIAL_PRICE; + } + /** * Resolve data persistence * From a5ac2dc694e4fa6224754e0a68936e252bd4c91c Mon Sep 17 00:00:00 2001 From: Dmytro Drozd Date: Thu, 1 Nov 2018 19:30:20 +0200 Subject: [PATCH 33/89] MAGETWO-96024: Invalid element declared for AdminProductGridSection section --- .../AdminProductGridActionGroup.xml | 23 +++++++++++++ .../Mftf/Section/AdminProductGridSection.xml | 1 + ...atusProductUsingProductGridActionGroup.xml | 33 ------------------- .../Mftf/Section/AdminProductGridSection.xml | 14 -------- 4 files changed, 24 insertions(+), 47 deletions(-) delete mode 100644 app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml delete mode 100644 app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml index 1bd9bb4a09c86..e17f9933cbcab 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml @@ -206,4 +206,27 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml index a7e20e22f1ddc..304cb621e5d9b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridSection.xml @@ -29,5 +29,6 @@ + diff --git a/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml b/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml deleted file mode 100644 index dba4a94f3db2a..0000000000000 --- a/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml b/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml deleted file mode 100644 index 32ac73aca7c03..0000000000000 --- a/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - -
- -
-
From 71e6f40b1c00b55fd59694ad040749ea26ebbb97 Mon Sep 17 00:00:00 2001 From: Alexandr Voronoy Date: Fri, 2 Nov 2018 11:31:20 +0200 Subject: [PATCH 34/89] Removed method annotation without argument from PHPDoc --- app/code/Magento/Backend/Block/Widget/Grid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Backend/Block/Widget/Grid.php b/app/code/Magento/Backend/Block/Widget/Grid.php index 72ab5a265d808..e9394be9e60bd 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid.php +++ b/app/code/Magento/Backend/Block/Widget/Grid.php @@ -12,7 +12,7 @@ * @api * @deprecated 100.2.0 in favour of UI component implementation * @method string getRowClickCallback() getRowClickCallback() - * @method \Magento\Backend\Block\Widget\Grid setRowClickCallback() setRowClickCallback(string $value) + * @method \Magento\Backend\Block\Widget\Grid setRowClickCallback(string $value) * @SuppressWarnings(PHPMD.TooManyFields) * @since 100.0.2 */ From effd4cd58724717aa561f8745a13b32c1d5125f2 Mon Sep 17 00:00:00 2001 From: Bernard van der Esch Date: Fri, 2 Nov 2018 11:29:18 +0100 Subject: [PATCH 35/89] missing use statement in layout generator --- lib/internal/Magento/Framework/View/Layout/Generator/Block.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php index bc250c54e7946..c69421cda339a 100755 --- a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php +++ b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php @@ -6,6 +6,7 @@ namespace Magento\Framework\View\Layout\Generator; use Magento\Framework\App\State; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\ObjectManager\Config\Reader\Dom; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Layout; From 166259009ae6e741ca90c98472c763d488a6839d Mon Sep 17 00:00:00 2001 From: Bernard van der Esch Date: Fri, 2 Nov 2018 11:43:29 +0100 Subject: [PATCH 36/89] import class to the use statement --- lib/internal/Magento/Framework/View/Layout/Generator/Block.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php index c69421cda339a..f0e62fce2a7ce 100755 --- a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php +++ b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php @@ -273,7 +273,7 @@ protected function getBlockInstance($block, array $arguments = []) } } if (!$block instanceof \Magento\Framework\View\Element\AbstractBlock) { - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( new \Magento\Framework\Phrase( 'Invalid block type: %1', [is_object($block) ? get_class($block) : (string) $block] From 5224958b90b3013b5c213e1b76e2522a3ca2e45e Mon Sep 17 00:00:00 2001 From: Oleksii Gorbulin Date: Fri, 2 Nov 2018 13:20:59 +0200 Subject: [PATCH 37/89] Add-validation-new-from-date-less-than-new-to-date-in-SCV-product-import add validation for fields new_from_date and new_to_date to make sure field new_from_date < new_to_date to prevent future errors during saving updated product --- .../Model/Import/Product.php | 29 +++++++++++++++++-- .../Import/Product/RowValidatorInterface.php | 2 ++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 6f8b2248d8d89..0595617fcf382 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -132,6 +132,16 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity */ const COL_NAME = 'name'; + /** + * Column new_from_date. + */ + const COL_NEW_FROM_DATE = 'new_from_date'; + + /** + * Column new_to_date. + */ + const COL_NEW_TO_DATE = 'new_to_date'; + /** * Column product website. */ @@ -298,6 +308,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity ValidatorInterface::ERROR_INVALID_WEIGHT => 'Product weight is invalid', ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually', ValidatorInterface::ERROR_DUPLICATE_MULTISELECT_VALUES => "Value for multiselect attribute %s contains duplicated values", + ValidatorInterface::ERROR_NEW_TO_DATE => 'Make sure new_to_date is later than or the same as new_from_date', ]; //@codingStandardsIgnoreEnd @@ -319,8 +330,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity Product::COL_TYPE => 'product_type', Product::COL_PRODUCT_WEBSITES => 'product_websites', 'status' => 'product_online', - 'news_from_date' => 'new_from_date', - 'news_to_date' => 'new_to_date', + 'news_from_date' => self::COL_NEW_FROM_DATE, + 'news_to_date' => self::COL_NEW_TO_DATE, 'options_container' => 'display_product_options_in', 'minimal_price' => 'map_price', 'msrp' => 'msrp_price', @@ -2546,6 +2557,20 @@ public function validateRow(array $rowData, $rowNum) } } } + + if (!empty($rowData[self::COL_NEW_FROM_DATE]) && !empty($rowData[self::COL_NEW_TO_DATE]) + ) { + $newFromTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_FROM_DATE], false)); + $newToTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_TO_DATE], false)); + if ($newFromTimestamp > $newToTimestamp) { + $this->addRowError( + ValidatorInterface::ERROR_NEW_TO_DATE, + $rowNum, + $rowData[self::COL_NEW_TO_DATE] + ); + } + } + return !$this->getErrorAggregator()->isRowInvalid($rowNum); } diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/RowValidatorInterface.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/RowValidatorInterface.php index f41596ad185a6..cbdc5f5beaaf9 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/RowValidatorInterface.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/RowValidatorInterface.php @@ -87,6 +87,8 @@ interface RowValidatorInterface extends \Magento\Framework\Validator\ValidatorIn const ERROR_DUPLICATE_MULTISELECT_VALUES = 'duplicatedMultiselectValues'; + const ERROR_NEW_TO_DATE = 'invalidNewToDateValue'; + /** * Value that means all entities (e.g. websites, groups etc.) */ From c333367742e668ea824c09675eb059fb246181a2 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Fri, 2 Nov 2018 17:09:46 +0200 Subject: [PATCH 38/89] #13157 - Last Ordered Items block - bad js code --- .../view/frontend/templates/reorder/sidebar.phtml | 14 +++++++++----- .../frontend/web/js/view/last-ordered-items.js | 12 ++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml b/app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml index 5ecf1ebe893bc..370e034ead64a 100644 --- a/app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml @@ -26,14 +26,18 @@
  1. -
    +
    @@ -46,8 +50,8 @@
-
+
diff --git a/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js b/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js index f393cc3fcd3bc..9897666653df9 100644 --- a/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js +++ b/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js @@ -12,18 +12,14 @@ define([ return Component.extend({ /** @inheritdoc */ initialize: function () { - var isShowAddToCart = false, - item; + var isShowAddToCart; this._super(); this.lastOrderedItems = customerData.get('last-ordered-items'); - for (item in this.lastOrderedItems.items) { - if (item['is_saleable']) { - isShowAddToCart = true; - break; - } - } + isShowAddToCart = _.some(this.lastOrderedItems().items, { + 'is_saleable': true + }); this.lastOrderedItems.isShowAddToCart = isShowAddToCart; } From 4a945f2807c391d6a5aca92ffb7cd4a09f9aa2f0 Mon Sep 17 00:00:00 2001 From: Abrar pathan Date: Sat, 3 Nov 2018 11:58:43 +0530 Subject: [PATCH 39/89] fixed-18887-notifications-counter --- .../css/source/module/header/actions-group/_notifications.less | 1 + 1 file changed, 1 insertion(+) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less index c9c97930297cb..93fc0d3eb4948 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less @@ -103,6 +103,7 @@ padding: .3em .5em; position: absolute; top: 50%; + width: 18px; } } From 518b4d4a181ffd60d57909b12b07fd39f149d9c7 Mon Sep 17 00:00:00 2001 From: David Manners Date: Mon, 5 Nov 2018 14:41:29 +0000 Subject: [PATCH 40/89] magento-engcom/import-export-improvements#126: update the download controller to implement the HttpGetActionInterface --- .../ImportExport/Controller/Adminhtml/History/Download.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php b/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php index 4dda5ebc4a310..d46fda9a1c0ef 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php @@ -6,9 +6,10 @@ */ namespace Magento\ImportExport\Controller\Adminhtml\History; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\Filesystem\DirectoryList; -class Download extends \Magento\ImportExport\Controller\Adminhtml\History +class Download extends \Magento\ImportExport\Controller\Adminhtml\History implements HttpGetActionInterface { /** * @var \Magento\Framework\Controller\Result\RawFactory From ca90fef1a09a8dc0e03299df89ba7c0e24ea05dc Mon Sep 17 00:00:00 2001 From: Dmytro Drozd Date: Mon, 5 Nov 2018 18:40:22 +0200 Subject: [PATCH 41/89] MAGETWO-96024: Invalid element declared for AdminProductGridSection section. Delete empty files --- .../ChangeStatusProductUsingProductGridActionGroup.xml | 0 .../Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml delete mode 100644 app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml diff --git a/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml b/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml b/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 4803537b41f6ca2b059c2a64a3c2a03d7c9482e1 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Tue, 6 Nov 2018 13:03:59 +0200 Subject: [PATCH 42/89] #13157 - Last Ordered Items block - bad js code --- .../Sales/view/frontend/web/js/view/last-ordered-items.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js b/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js index 9897666653df9..74465128f8c72 100644 --- a/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js +++ b/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js @@ -5,8 +5,9 @@ define([ 'uiComponent', - 'Magento_Customer/js/customer-data' -], function (Component, customerData) { + 'Magento_Customer/js/customer-data', + 'underscore' +], function (Component, customerData, _) { 'use strict'; return Component.extend({ From 1f1ec545f4a9e6d39dfd1ad186ecf2bafae36496 Mon Sep 17 00:00:00 2001 From: Alexandr Voronoy Date: Sat, 10 Nov 2018 20:01:19 +0200 Subject: [PATCH 43/89] Cleanup with static test --- app/code/Magento/Backend/Block/Widget/Grid.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Backend/Block/Widget/Grid.php b/app/code/Magento/Backend/Block/Widget/Grid.php index e9394be9e60bd..66298d23389fb 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid.php +++ b/app/code/Magento/Backend/Block/Widget/Grid.php @@ -150,7 +150,10 @@ public function __construct( } /** + * Internal constructor, that is called from real constructor + * * @return void + * * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function _construct() @@ -709,6 +712,7 @@ public function getGridUrl() /** * Grid url getter + * * Version of getGridUrl() but with parameters * * @param array $params url parameters From ae61da5e5351745664672d17ad77059273d0af00 Mon Sep 17 00:00:00 2001 From: Oleksii Gorbulin Date: Sat, 10 Nov 2018 20:06:15 +0200 Subject: [PATCH 44/89] 19082-Fatal-error-Uncaught-Error-Cannot-call-abstract-method-Magento-Framework-App-ActionInterface-execute add method to prevent fatal error when go to catalog/product/compare/ --- app/code/Magento/Catalog/Controller/Product/Compare.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/code/Magento/Catalog/Controller/Product/Compare.php b/app/code/Magento/Catalog/Controller/Product/Compare.php index 1ee146e5aaa70..63478080bce1a 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare.php @@ -139,4 +139,13 @@ public function setCustomerId($customerId) $this->_customerId = $customerId; return $this; } + + /** + * {@inheritdoc} + */ + public function execute() + { + return $this->_redirect('catalog/product_compare'); + } + } From 29a86a3907115d0f186d9937a5f90d45626f6566 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Mon, 12 Nov 2018 15:35:16 +0200 Subject: [PATCH 45/89] magento/magento2#16887: [Forwardport] Fix blocked a frame with origin. --- .../view/frontend/web/js/page-cache.js | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js index fccc8510ffc70..11707ea491fb5 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js @@ -6,9 +6,10 @@ define([ 'jquery', 'domReady', + 'consoleLogger', 'jquery/ui', 'mage/cookies' -], function ($, domReady) { +], function ($, domReady, consoleLogger) { 'use strict'; /** @@ -46,14 +47,30 @@ define([ // prevent cross origin iframe content reading if ($(element).prop('tagName') === 'IFRAME') { iframeHostName = $('').prop('href', $(element).prop('src')) - .prop('hostname'); + .prop('hostname'); if (window.location.hostname !== iframeHostName) { return []; } } - $(element).contents().each(function (index, el) { + // rewrite jQuery contents() + var contents = function (element) { + return $.map(element, function (elem) { + try { + return $.nodeName(elem, "iframe") ? + elem.contentDocument || (elem.contentWindow ? elem.contentWindow.document : []) : + $.merge([], elem.childNodes); + } catch (e) { + consoleLogger.error(e); + return []; + } + }); + }; + + var elementContents = contents($(element)); + + $.each(elementContents, function (index, el) { switch (el.nodeType) { case 1: // ELEMENT_NODE lookup(el); From 0e59e8c244463d74e7949bbb1710d13f1990537d Mon Sep 17 00:00:00 2001 From: saphal Date: Tue, 13 Nov 2018 10:36:08 +0530 Subject: [PATCH 46/89] code updated as per instructions --- app/code/Magento/Review/Model/ResourceModel/Rating.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 77a9727bd849e..04dce420ae522 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -425,11 +425,11 @@ public function getReviewSummary($object, $onlyForCurrentStore = true) $data = $connection->fetchAll($select, [':review_id' => $object->getReviewId()]); - $currentStore = ($this->_storeManager->isSingleStoreMode()) ? $this->_storeManager->getStore()->getId() : NULL ; + $currentStore = ($this->_storeManager->isSingleStoreMode()) ? $this->_storeManager->getStore()->getId() : null ; if ($onlyForCurrentStore) { foreach ($data as $row) { - if (!$row['store_id'] == $currentStore) { + if ($row['store_id'] !== $currentStore) { $object->addData($row); } } From e697698a5be421e215f6bab5454d706eed97fb6e Mon Sep 17 00:00:00 2001 From: Magently Date: Fri, 24 Aug 2018 16:58:02 +0200 Subject: [PATCH 47/89] Fix addExpressionFieldToSelect method generated columns get overwriten by addFieldToSelect() --- .../Model/ResourceModel/Db/Collection/AbstractCollection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php index b57755ed7eafa..a88e013f5d2fe 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php @@ -346,7 +346,9 @@ public function addExpressionFieldToSelect($alias, $expression, $fields) $fullExpression = str_replace('{{' . $fieldKey . '}}', $fieldItem, $fullExpression); } - $this->getSelect()->columns([$alias => $fullExpression]); + $fullExpression = new \Zend_Db_Expr($fullExpression); + $this->_fieldsToSelect[$alias] = $fullExpression; + $this->_fieldsToSelectChanged = true; return $this; } From 3050d2367c284bded10815e7cd559b7bc3937546 Mon Sep 17 00:00:00 2001 From: Magently Date: Tue, 4 Sep 2018 13:53:08 +0200 Subject: [PATCH 48/89] Fix integration test Changed test method to fit the new implementation of the class method --- .../ResourceModel/Db/Collection/AbstractCollectionTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php index 4f27f083509d7..7989a265e0db1 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php @@ -267,10 +267,11 @@ public function addFieldToSelectDataProvider() /** * @dataProvider addExpressionFieldToSelectDataProvider */ - public function testAddExpressionFieldToSelect($alias, $expression, $fields, $expected) + public function testAddExpressionFieldToSelect($alias, $expression, $fields, $expectedFieldsToSelect) { - $this->selectMock->expects($this->once())->method('columns')->with($expected); $this->assertTrue($this->uut->addExpressionFieldToSelect($alias, $expression, $fields) instanceof Uut); + $this->assertEquals($expectedFieldsToSelect, $this->uut->getFieldsToSelect()); + $this->assertTrue($this->uut->wereFieldsToSelectChanged()); } /** From 99ea1956fd75f7aeef809c90a3ec45f2cdbbd619 Mon Sep 17 00:00:00 2001 From: Magently Date: Tue, 4 Sep 2018 15:24:11 +0200 Subject: [PATCH 49/89] Fix variable name in test class too long --- .../ResourceModel/Db/Collection/AbstractCollectionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php index 7989a265e0db1..0eae94dabbbe8 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php @@ -267,10 +267,10 @@ public function addFieldToSelectDataProvider() /** * @dataProvider addExpressionFieldToSelectDataProvider */ - public function testAddExpressionFieldToSelect($alias, $expression, $fields, $expectedFieldsToSelect) + public function testAddExpressionFieldToSelect($alias, $expression, $fields, $expected) { $this->assertTrue($this->uut->addExpressionFieldToSelect($alias, $expression, $fields) instanceof Uut); - $this->assertEquals($expectedFieldsToSelect, $this->uut->getFieldsToSelect()); + $this->assertEquals($expected, $this->uut->getFieldsToSelect()); $this->assertTrue($this->uut->wereFieldsToSelectChanged()); } From 1050136cd115936306c12176a281114f2dbe4d3a Mon Sep 17 00:00:00 2001 From: eduard13 Date: Tue, 13 Nov 2018 12:10:56 +0200 Subject: [PATCH 50/89] Adding integration tests for wrong captcha on login and forgotpassword pages --- ...successfulMessageWhenCaptchaFailedTest.php | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Captcha/Observer/CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest.php diff --git a/dev/tests/integration/testsuite/Magento/Captcha/Observer/CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest.php b/dev/tests/integration/testsuite/Magento/Captcha/Observer/CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest.php new file mode 100644 index 0000000000000..cb2a98409bc24 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest.php @@ -0,0 +1,78 @@ +_objectManager->get(\Magento\Framework\Data\Form\FormKey::class); + $post = [ + 'login' => [ + 'username' => 'dummy@dummy.com', + 'password' => 'dummy_password1', + ], + 'captcha' => ['user_login' => 'wrong_captcha'], + 'form_key' => $formKey->getFormKey(), + ]; + + $this->getRequest()->setMethod(Request::METHOD_POST); + $this->getRequest()->setPostValue($post); + + $this->dispatch('customer/account/loginPost'); + + $this->assertRedirect($this->stringContains('customer/account/login')); + $this->assertSessionMessages( + $this->equalTo(['Incorrect CAPTCHA']), + MessageInterface::TYPE_ERROR + ); + } + + /** + * Test incorrect captcha on customer forgot password page + * + * @codingStandardsIgnoreStart + * @magentoConfigFixture current_store customer/password/limit_password_reset_requests_method 0 + * @magentoConfigFixture default_store customer/captcha/enable 1 + * @magentoConfigFixture default_store customer/captcha/forms user_forgotpassword + * @magentoConfigFixture default_store customer/captcha/mode always + */ + public function testForgotPasswordCheckUnsuccessfulMessageWhenCaptchaFailed() + { + $email = 'dummy@dummy.com'; + + $this->getRequest()->setPostValue(['email' => $email]); + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + + $this->dispatch('customer/account/forgotPasswordPost'); + + $this->assertRedirect($this->stringContains('customer/account/forgotpassword')); + $this->assertSessionMessages( + $this->equalTo(['Incorrect CAPTCHA']), + MessageInterface::TYPE_ERROR + ); + } +} From cbe6a4492e8b3d9ec8d75169c353d67685b99d55 Mon Sep 17 00:00:00 2001 From: eduard13 Date: Tue, 13 Nov 2018 12:45:21 +0200 Subject: [PATCH 51/89] Adding integration tests for wrong captcha on customer create page --- ...successfulMessageWhenCaptchaFailedTest.php | 58 ++++++++++++++++--- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Captcha/Observer/CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest.php b/dev/tests/integration/testsuite/Magento/Captcha/Observer/CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest.php index cb2a98409bc24..8355d81fdf5d9 100644 --- a/dev/tests/integration/testsuite/Magento/Captcha/Observer/CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest.php +++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest.php @@ -5,7 +5,7 @@ */ namespace Magento\Captcha\Observer; -use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\Data\Form\FormKey; use Magento\Framework\Message\MessageInterface; use Magento\TestFramework\Request; use Magento\TestFramework\TestCase\AbstractController; @@ -28,8 +28,8 @@ class CaseCheckOnFrontendUnsuccessfulMessageWhenCaptchaFailedTest extends Abstra */ public function testLoginCheckUnsuccessfulMessageWhenCaptchaFailed() { - /** @var \Magento\Framework\Data\Form\FormKey $formKey */ - $formKey = $this->_objectManager->get(\Magento\Framework\Data\Form\FormKey::class); + /** @var FormKey $formKey */ + $formKey = $this->_objectManager->get(FormKey::class); $post = [ 'login' => [ 'username' => 'dummy@dummy.com', @@ -39,8 +39,7 @@ public function testLoginCheckUnsuccessfulMessageWhenCaptchaFailed() 'form_key' => $formKey->getFormKey(), ]; - $this->getRequest()->setMethod(Request::METHOD_POST); - $this->getRequest()->setPostValue($post); + $this->prepareRequestData($post); $this->dispatch('customer/account/loginPost'); @@ -62,10 +61,8 @@ public function testLoginCheckUnsuccessfulMessageWhenCaptchaFailed() */ public function testForgotPasswordCheckUnsuccessfulMessageWhenCaptchaFailed() { - $email = 'dummy@dummy.com'; - - $this->getRequest()->setPostValue(['email' => $email]); - $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $post = ['email' => 'dummy@dummy.com']; + $this->prepareRequestData($post); $this->dispatch('customer/account/forgotPasswordPost'); @@ -75,4 +72,47 @@ public function testForgotPasswordCheckUnsuccessfulMessageWhenCaptchaFailed() MessageInterface::TYPE_ERROR ); } + + /** + * Test incorrect captcha on customer create account page + * + * @codingStandardsIgnoreStart + * @magentoConfigFixture current_store customer/password/limit_password_reset_requests_method 0 + * @magentoConfigFixture default_store customer/captcha/enable 1 + * @magentoConfigFixture default_store customer/captcha/forms user_create + * @magentoConfigFixture default_store customer/captcha/mode always + */ + public function testCreateAccountCheckUnsuccessfulMessageWhenCaptchaFailed() + { + /** @var FormKey $formKey */ + $formKey = $this->_objectManager->get(FormKey::class); + $post = [ + 'firstname' => 'Firstname', + 'lastname' => 'Lastname', + 'email' => 'dummy@dummy.com', + 'password' => 'TestPassword123', + 'password_confirmation' => 'TestPassword123', + 'captcha' => ['user_create' => 'wrong_captcha'], + 'form_key' => $formKey->getFormKey(), + ]; + $this->prepareRequestData($post); + + $this->dispatch('customer/account/createPost'); + + $this->assertRedirect($this->stringContains('customer/account/create')); + $this->assertSessionMessages( + $this->equalTo(['Incorrect CAPTCHA']), + MessageInterface::TYPE_ERROR + ); + } + + /** + * @param array $postData + * @return void + */ + private function prepareRequestData($postData) + { + $this->getRequest()->setMethod(Request::METHOD_POST); + $this->getRequest()->setPostValue($postData); + } } From c9b52500a52067b8ccfc3329b7456512b6520526 Mon Sep 17 00:00:00 2001 From: eduard13 Date: Tue, 13 Nov 2018 18:37:09 +0200 Subject: [PATCH 52/89] Fixing the customer subscribing from different stores --- .../Model/Plugin/CustomerPlugin.php | 18 ++++++++++--- .../Unit/Model/Plugin/CustomerPluginTest.php | 25 +++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 22b31575debbc..f7467ef07aadb 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -6,11 +6,13 @@ namespace Magento\Newsletter\Model\Plugin; use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository; +use Magento\Customer\Api\Data\CustomerExtensionInterface; use Magento\Customer\Api\Data\CustomerInterface; -use Magento\Newsletter\Model\SubscriberFactory; use Magento\Framework\Api\ExtensionAttributesFactory; +use Magento\Framework\App\ObjectManager; use Magento\Newsletter\Model\ResourceModel\Subscriber; -use Magento\Customer\Api\Data\CustomerExtensionInterface; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Store\Model\StoreManagerInterface; class CustomerPlugin { @@ -36,21 +38,29 @@ class CustomerPlugin */ private $customerSubscriptionStatus = []; + /** + * @var StoreManagerInterface + */ + private $storeManager; + /** * Initialize dependencies. * * @param SubscriberFactory $subscriberFactory * @param ExtensionAttributesFactory $extensionFactory * @param Subscriber $subscriberResource + * @param StoreManagerInterface|null $storeManager */ public function __construct( SubscriberFactory $subscriberFactory, ExtensionAttributesFactory $extensionFactory, - Subscriber $subscriberResource + Subscriber $subscriberResource, + StoreManagerInterface $storeManager = null ) { $this->subscriberFactory = $subscriberFactory; $this->extensionFactory = $extensionFactory; $this->subscriberResource = $subscriberResource; + $this->storeManager = $storeManager ?: ObjectManager::getInstance()->get(StoreManagerInterface::class); } /** @@ -155,6 +165,8 @@ public function afterGetById(CustomerRepository $subject, CustomerInterface $cus if ($extensionAttributes === null) { /** @var CustomerExtensionInterface $extensionAttributes */ $extensionAttributes = $this->extensionFactory->create(CustomerInterface::class); + $storeId = $this->storeManager->getStore()->getId(); + $customer->setStoreId($storeId); $customer->setExtensionAttributes($extensionAttributes); } if ($extensionAttributes->getIsSubscribed() === null) { diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php index e809b7e37a432..3be28cacc93e0 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php @@ -10,6 +10,8 @@ use Magento\Customer\Api\Data\CustomerExtensionInterface; use Magento\Framework\Api\ExtensionAttributesFactory; use Magento\Newsletter\Model\ResourceModel\Subscriber; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; class CustomerPluginTest extends \PHPUnit\Framework\TestCase { @@ -53,6 +55,11 @@ class CustomerPluginTest extends \PHPUnit\Framework\TestCase */ private $customerMock; + /** + * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $storeManagerMock; + protected function setUp() { $this->subscriberFactory = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) @@ -87,6 +94,8 @@ protected function setUp() ->setMethods(['getExtensionAttributes']) ->disableOriginalConstructor() ->getMockForAbstractClass(); + $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); + $this->subscriberFactory->expects($this->any())->method('create')->willReturn($this->subscriber); $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -96,6 +105,7 @@ protected function setUp() 'subscriberFactory' => $this->subscriberFactory, 'extensionFactory' => $this->extensionFactoryMock, 'subscriberResource' => $this->subscriberResourceMock, + 'storeManager' => $this->storeManagerMock, ] ); } @@ -206,6 +216,7 @@ public function testAfterGetByIdCreatesExtensionAttributesIfItIsNotSet( ) { $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); $subscriber = [$subscriberStatusKey => $subscriberStatusValue]; + $this->prepareStoreData(); $this->extensionFactoryMock->expects($this->any()) ->method('create') @@ -233,6 +244,7 @@ public function testAfterGetByIdSetsIsSubscribedFlagIfItIsNotSet() { $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); $subscriber = ['subscriber_id' => 1, 'subscriber_status' => 1]; + $this->prepareStoreData(); $this->customerMock->expects($this->any()) ->method('getExtensionAttributes') @@ -267,4 +279,17 @@ public function afterGetByIdDataProvider() [null, null, false], ]; } + + /** + * Prepare store information + * + * @return void + */ + private function prepareStoreData() + { + $storeId = 1; + $storeMock = $this->createMock(Store::class); + $storeMock->expects($this->any())->method('getId')->willReturn($storeId); + $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($storeMock); + } } From 3b84172faf8612ca7fc54c4c3bb131923e521c01 Mon Sep 17 00:00:00 2001 From: eduard13 Date: Tue, 13 Nov 2018 19:07:45 +0200 Subject: [PATCH 53/89] Small refactoring --- app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index f7467ef07aadb..7c8a92397d8c5 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -161,12 +161,11 @@ public function afterDelete(CustomerRepository $subject, $result, CustomerInterf public function afterGetById(CustomerRepository $subject, CustomerInterface $customer) { $extensionAttributes = $customer->getExtensionAttributes(); - + $storeId = $this->storeManager->getStore()->getId(); + $customer->setStoreId($storeId); if ($extensionAttributes === null) { /** @var CustomerExtensionInterface $extensionAttributes */ $extensionAttributes = $this->extensionFactory->create(CustomerInterface::class); - $storeId = $this->storeManager->getStore()->getId(); - $customer->setStoreId($storeId); $customer->setExtensionAttributes($extensionAttributes); } if ($extensionAttributes->getIsSubscribed() === null) { From 7c9de8e88705824b07378de2bca5ae383c5c80fb Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Tue, 13 Nov 2018 13:25:39 -0600 Subject: [PATCH 54/89] #13157 - Last Ordered Items block - bad js code --- .../frontend/templates/reorder/sidebar.phtml | 2 +- .../web/js/view/last-ordered-items.js | 27 ++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml b/app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml index 370e034ead64a..9b3633fde60b4 100644 --- a/app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml @@ -51,7 +51,7 @@
+ data-bind="visible: isShowAddToCart"> diff --git a/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js b/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js index 74465128f8c72..17e61a77d98a3 100644 --- a/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js +++ b/app/code/Magento/Sales/view/frontend/web/js/view/last-ordered-items.js @@ -11,18 +11,37 @@ define([ 'use strict'; return Component.extend({ + defaults: { + isShowAddToCart: false + }, + /** @inheritdoc */ initialize: function () { - var isShowAddToCart; - this._super(); this.lastOrderedItems = customerData.get('last-ordered-items'); + this.lastOrderedItems.subscribe(this.checkSalableItems.bind(this)); + this.checkSalableItems(); + + return this; + }, + + /** @inheritdoc */ + initObservable: function () { + this._super() + .observe('isShowAddToCart'); + + return this; + }, - isShowAddToCart = _.some(this.lastOrderedItems().items, { + /** + * Check if items is_saleable and change add to cart button visibility. + */ + checkSalableItems: function () { + var isShowAddToCart = _.some(this.lastOrderedItems().items, { 'is_saleable': true }); - this.lastOrderedItems.isShowAddToCart = isShowAddToCart; + this.isShowAddToCart(isShowAddToCart); } }); }); From a9bdbdb95a4156aa3e05d31d245b3057c08f7080 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Wed, 14 Nov 2018 11:21:43 +0200 Subject: [PATCH 55/89] magento/magento2#13095: [Forwardport] No locale for Swedish (Finland). --- lib/internal/Magento/Framework/Locale/Config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Locale/Config.php b/lib/internal/Magento/Framework/Locale/Config.php index 8767bd515db82..790fa9c924c8e 100644 --- a/lib/internal/Magento/Framework/Locale/Config.php +++ b/lib/internal/Magento/Framework/Locale/Config.php @@ -90,6 +90,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface 'sq_AL', /*Albanian (Albania)*/ 'sr_Cyrl_RS', /*Serbian (Serbia)*/ 'sv_SE', /*Swedish (Sweden)*/ + 'sv_FI', /*Swedish (Finland)*/ 'sw_KE', /*Swahili (Kenya)*/ 'th_TH', /*Thai (Thailand)*/ 'tr_TR', /*Turkish (Turkey)*/ From ace100593b2903cbd79b9f3b4d0f49108b5465d4 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Wed, 31 Oct 2018 10:17:55 +0200 Subject: [PATCH 56/89] ENGCOM-3449: Fix/add expresion. --- .../Db/Collection/AbstractTest.php | 38 +++++++++++++++++++ .../Db/Collection/AbstractCollection.php | 14 +++++-- .../Db/Collection/AbstractCollectionTest.php | 3 +- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractTest.php index 419a7d04b778a..2ee0953dcdbf1 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractTest.php @@ -72,4 +72,42 @@ public function testGetAllIdsWithBind() $this->_model->addBindParam('code', 'admin'); $this->assertEquals(['0'], $this->_model->getAllIds()); } + + /** + * Check add field to select doesn't remove expression field from select. + * + * @return void + */ + public function testAddExpressionFieldToSelectWithAdditionalFields() + { + $expectedColumns = ['code', 'test_field']; + $actualColumns = []; + + $testExpression = new \Zend_Db_Expr('(sort_order + group_id)'); + $this->_model->addExpressionFieldToSelect('test_field', $testExpression, ['sort_order', 'group_id']); + $this->_model->addFieldToSelect('code', 'code'); + $columns = $this->_model->getSelect()->getPart(\Magento\Framework\DB\Select::COLUMNS); + foreach ($columns as $columnEntry) { + $actualColumns[] = $columnEntry[2]; + } + + $this->assertEquals($expectedColumns, $actualColumns); + } + + /** + * Check add expression field doesn't remove all fields from select. + * + * @return void + */ + public function testAddExpressionFieldToSelectWithoutAdditionalFields() + { + $expectedColumns = ['*', 'test_field']; + + $testExpression = new \Zend_Db_Expr('(sort_order + group_id)'); + $this->_model->addExpressionFieldToSelect('test_field', $testExpression, ['sort_order', 'group_id']); + $columns = $this->_model->getSelect()->getPart(\Magento\Framework\DB\Select::COLUMNS); + $actualColumns = [$columns[0][1], $columns[1][2]]; + + $this->assertEquals($expectedColumns, $actualColumns); + } } diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php index a88e013f5d2fe..6e1ea24a61a4a 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php @@ -45,6 +45,13 @@ abstract class AbstractCollection extends AbstractDb implements SourceProviderIn */ protected $_fieldsToSelect = null; + /** + * Expression fields to select in query. + * + * @var array + */ + private $expressionFieldsToSelect = []; + /** * Fields initial fields to select like id_field * @@ -205,7 +212,7 @@ protected function _initSelectFields() $columnsToSelect = []; foreach ($columns as $columnEntry) { list($correlationName, $column, $alias) = $columnEntry; - if ($correlationName !== 'main_table') { + if ($correlationName !== 'main_table' || isset($this->expressionFieldsToSelect[$alias])) { // Add joined fields to select if ($column instanceof \Zend_Db_Expr) { $column = $column->__toString(); @@ -346,9 +353,8 @@ public function addExpressionFieldToSelect($alias, $expression, $fields) $fullExpression = str_replace('{{' . $fieldKey . '}}', $fieldItem, $fullExpression); } - $fullExpression = new \Zend_Db_Expr($fullExpression); - $this->_fieldsToSelect[$alias] = $fullExpression; - $this->_fieldsToSelectChanged = true; + $this->getSelect()->columns([$alias => $fullExpression]); + $this->expressionFieldsToSelect[$alias] = $fullExpression; return $this; } diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php index 0eae94dabbbe8..4f27f083509d7 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php @@ -269,9 +269,8 @@ public function addFieldToSelectDataProvider() */ public function testAddExpressionFieldToSelect($alias, $expression, $fields, $expected) { + $this->selectMock->expects($this->once())->method('columns')->with($expected); $this->assertTrue($this->uut->addExpressionFieldToSelect($alias, $expression, $fields) instanceof Uut); - $this->assertEquals($expected, $this->uut->getFieldsToSelect()); - $this->assertTrue($this->uut->wereFieldsToSelectChanged()); } /** From 88a8763ab8646d2e7d69c344507a4701e0bcd3f0 Mon Sep 17 00:00:00 2001 From: Yevhenii Dumskyi Date: Wed, 14 Nov 2018 12:03:34 +0200 Subject: [PATCH 57/89] Fix selection of all items which are not visible in ui grid --- app/code/Magento/Ui/view/base/web/js/grid/massactions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js index 48c04458ff49a..2e87e00fecda9 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js @@ -153,6 +153,11 @@ define([ var itemsType = data.excludeMode ? 'excluded' : 'selected', selections = {}; + if (itemsType === 'excluded' && data['selected'].length){ + data['selected'] = _.difference(data['selected'], data['excluded']); + itemsType = 'selected'; + } + selections[itemsType] = data[itemsType]; if (!selections[itemsType].length) { From ee50fcbca5726e4fbb120e72749e7ec9b7c45c50 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Wed, 14 Nov 2018 17:13:20 +0200 Subject: [PATCH 58/89] ENGCOM-3449: Fixed static test. --- .../Model/ResourceModel/Db/Collection/AbstractCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php index 6e1ea24a61a4a..8ec47ed97e11c 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php @@ -177,7 +177,7 @@ public function setMainTable($table) } /** - * {@inheritdoc} + * @inheritdoc */ protected function _initSelect() { From e90bc28be176ec24b027ba05e4d74882738ac1c9 Mon Sep 17 00:00:00 2001 From: Yevhenii Dumskyi Date: Wed, 14 Nov 2018 17:41:44 +0200 Subject: [PATCH 59/89] Fix static analysis errors --- app/code/Magento/Ui/view/base/web/js/grid/massactions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js index 2e87e00fecda9..f26ca8697c2ff 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/massactions.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/massactions.js @@ -153,9 +153,9 @@ define([ var itemsType = data.excludeMode ? 'excluded' : 'selected', selections = {}; - if (itemsType === 'excluded' && data['selected'].length){ - data['selected'] = _.difference(data['selected'], data['excluded']); + if (itemsType === 'excluded' && data.selected && data.selected.length) { itemsType = 'selected'; + data[itemsType] = _.difference(data.selected, data.excluded); } selections[itemsType] = data[itemsType]; From ec040afdb5692c435d58c70914471b64216f7059 Mon Sep 17 00:00:00 2001 From: Alexandre Jardin Date: Wed, 14 Nov 2018 16:35:10 +0100 Subject: [PATCH 60/89] Fix dependency between Elasticsearch configuration fields --- app/code/Magento/Elasticsearch/etc/adminhtml/system.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml index b9fddc46f78ec..dd42b408ff75e 100644 --- a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml @@ -92,15 +92,15 @@ - 1 elasticsearch5 + 1 - 1 elasticsearch5 + 1 From 5ef851a596363d40ed259d10f10299a43b6891bf Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Fri, 16 Nov 2018 10:30:35 +0200 Subject: [PATCH 61/89] =?UTF-8?q?ENGCOM-3435:=2019082-Fatal-error-Uncaught?= =?UTF-8?q?-Error-Cannot-call-abstract-method-Magento-=E2=80=A6=20#19155?= =?UTF-8?q?=20Fix=20static=20tests.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Magento/Catalog/Controller/Product/Compare.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Controller/Product/Compare.php b/app/code/Magento/Catalog/Controller/Product/Compare.php index 63478080bce1a..084a82f87d645 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare.php @@ -6,6 +6,7 @@ namespace Magento\Catalog\Controller\Product; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\Data\Form\FormKey\Validator; use Magento\Framework\View\Result\PageFactory; @@ -15,7 +16,7 @@ * @SuppressWarnings(PHPMD.LongVariable) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -abstract class Compare extends \Magento\Framework\App\Action\Action +abstract class Compare extends \Magento\Framework\App\Action\Action implements HttpGetActionInterface { /** * Customer id @@ -141,11 +142,13 @@ public function setCustomerId($customerId) } /** - * {@inheritdoc} + * @inheritdoc */ public function execute() { - return $this->_redirect('catalog/product_compare'); - } + $resultRedirect = $this->resultRedirectFactory->create(); + $resultRedirect->setPath('catalog/product_compare'); + return $resultRedirect; + } } From 6a68a187e972b1e241e55153b0ba2a1483255f92 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Fri, 16 Nov 2018 10:30:31 -0600 Subject: [PATCH 62/89] ENGCOM-3291: Set cache id prefix on installation #18641 - fixed docblock --- setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php b/setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php index 85c0e2c4e9b3b..173064b472217 100644 --- a/setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php +++ b/setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php @@ -79,7 +79,7 @@ public function __construct(RedisConnectionValidator $redisValidator) } /** - * {@inheritdoc} + * @inheritdoc */ public function getOptions() { From 3ccd55e308823f8342c0503ab90af11b91c26f61 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Fri, 16 Nov 2018 10:30:59 -0600 Subject: [PATCH 63/89] ENGCOM-3291: Set cache id prefix on installation #18641 - fixed docblock --- setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php b/setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php index 35a9955aad506..7451b59356828 100644 --- a/setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php +++ b/setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php @@ -83,7 +83,7 @@ public function __construct(RedisConnectionValidator $redisValidator) } /** - * {@inheritdoc} + * @inheritdoc */ public function getOptions() { From f14949c840286e75199d9696377f65995fd69278 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Fri, 16 Nov 2018 10:31:38 -0600 Subject: [PATCH 64/89] ENGCOM-3291: Set cache id prefix on installation #18641 - fixed static test --- .../Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php index d804266096f7b..1cf3937f98684 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/ConfigOptionsList/PageCacheTest.php @@ -164,7 +164,6 @@ public function testCreateConfigWithFileCache() $this->assertEquals($expectedConfigData, $configData->getData()); } - /** * testCreateConfigCacheRedis */ From 571af253e06151ab02e570495b485560211e06c7 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Fri, 16 Nov 2018 18:49:33 +0200 Subject: [PATCH 65/89] MAGETWO-93425: Permanent Redirect for old URL missing via API or no documentation --- .../Controller/Rest/InputParamsResolver.php | 87 +++++++++++++ .../Rest/InputParamsResolverTest.php | 116 ++++++++++++++++++ .../CatalogUrlRewrite/etc/webapi_rest/di.xml | 3 + 3 files changed, 206 insertions(+) create mode 100644 app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php create mode 100644 app/code/Magento/CatalogUrlRewrite/Test/Unit/Plugin/Webapi/Controller/Rest/InputParamsResolverTest.php diff --git a/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php b/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php new file mode 100644 index 0000000000000..5d1eff81874be --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php @@ -0,0 +1,87 @@ +request = $request; + } + + /** + * Add 'save_rewrites_history' param to the product data + * + * @see \Magento\CatalogUrlRewrite\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper + * @param \Magento\Webapi\Controller\Rest\InputParamsResolver $subject + * @param array $result + * @return array + */ + public function afterResolve(\Magento\Webapi\Controller\Rest\InputParamsResolver $subject, array $result): array + { + $route = $subject->getRoute(); + $serviceMethodName = $route->getServiceMethod(); + $serviceClassName = $route->getServiceClass(); + $requestBodyParams = $this->request->getBodyParams(); + + if ($this->isProductSaveCalled($serviceClassName, $serviceMethodName) + && $this->isCustomOptionExists($requestBodyParams)) { + + foreach ($requestBodyParams['product']['custom_attributes'] as $attribute) { + if ($attribute['attribute_code'] === 'save_rewrites_history') { + foreach ($result as $resultItem) { + if ($resultItem instanceof \Magento\Catalog\Model\Product) { + $resultItem->setData('save_rewrites_history', (bool)$attribute['value']); + break 2; + } + } + } + } + } + return $result; + } + + /** + * Check that product save method called + * + * @param string $serviceClassName + * @param string $serviceMethodName + * @return bool + */ + private function isProductSaveCalled(string $serviceClassName, string $serviceMethodName): bool + { + return $serviceClassName === ProductRepositoryInterface::class && $serviceMethodName === 'save'; + } + + /** + * Check is any custom options exists in product data + * + * @param array $requestBodyParams + * @return bool + */ + private function isCustomOptionExists(array $requestBodyParams): bool + { + return !empty($requestBodyParams['product']['custom_attributes']); + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Plugin/Webapi/Controller/Rest/InputParamsResolverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Plugin/Webapi/Controller/Rest/InputParamsResolverTest.php new file mode 100644 index 0000000000000..8e705b2c09f6b --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Plugin/Webapi/Controller/Rest/InputParamsResolverTest.php @@ -0,0 +1,116 @@ +saveRewritesHistory = 'save_rewrites_history'; + $this->requestBodyParams = [ + 'product' => [ + 'sku' => 'test', + 'custom_attributes' => [ + ['attribute_code' => $this->saveRewritesHistory, 'value' => 1] + ] + ] + ]; + + $this->route = $this->createPartialMock(Route::class, ['getServiceMethod', 'getServiceClass']); + $this->request = $this->createPartialMock(RestRequest::class, ['getBodyParams']); + $this->request->expects($this->any())->method('getBodyParams')->willReturn($this->requestBodyParams); + $this->subject = $this->createPartialMock(InputParamsResolver::class, ['getRoute']); + $this->subject->expects($this->any())->method('getRoute')->willReturn($this->route); + $this->product = $this->createPartialMock(Product::class, ['setData']); + + $this->result = [false, $this->product, 'test']; + + $this->objectManager = new ObjectManager($this); + $this->plugin = $this->objectManager->getObject( + InputParamsResolverPlugin::class, + [ + 'request' => $this->request + ] + ); + } + + public function testAfterResolve() + { + $this->route->expects($this->once()) + ->method('getServiceClass') + ->willReturn(ProductRepositoryInterface::class); + $this->route->expects($this->once()) + ->method('getServiceMethod') + ->willReturn('save'); + $this->product->expects($this->once()) + ->method('setData') + ->with($this->saveRewritesHistory, true); + + $this->plugin->afterResolve($this->subject, $this->result); + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/etc/webapi_rest/di.xml b/app/code/Magento/CatalogUrlRewrite/etc/webapi_rest/di.xml index ac8beb362f0fb..34b7487725d76 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/webapi_rest/di.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/webapi_rest/di.xml @@ -7,4 +7,7 @@ --> + + + From 46d533e97bdd2c05560bf51f1ca0ed1b47a347ff Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Sun, 2 Sep 2018 16:11:02 +0200 Subject: [PATCH 66/89] Fixed child items showing on My Account order view --- app/code/Magento/Sales/Block/Order/Items.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Sales/Block/Order/Items.php b/app/code/Magento/Sales/Block/Order/Items.php index 028544cd56219..0b67e9a0746d3 100644 --- a/app/code/Magento/Sales/Block/Order/Items.php +++ b/app/code/Magento/Sales/Block/Order/Items.php @@ -71,7 +71,6 @@ protected function _prepareLayout() $this->itemCollection = $this->itemCollectionFactory->create(); $this->itemCollection->setOrderFilter($this->getOrder()); - $this->itemCollection->filterByParent(null); /** @var \Magento\Theme\Block\Html\Pager $pagerBlock */ $pagerBlock = $this->getChildBlock('sales_order_item_pager'); From b9790c67d25af83e8cbaecad223c4317d4337e8d Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Sun, 18 Nov 2018 11:50:50 +0200 Subject: [PATCH 67/89] Fixed code style issues --- app/code/Magento/Review/Model/ResourceModel/Rating.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 04dce420ae522..9cd9b0650a278 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -425,7 +425,7 @@ public function getReviewSummary($object, $onlyForCurrentStore = true) $data = $connection->fetchAll($select, [':review_id' => $object->getReviewId()]); - $currentStore = ($this->_storeManager->isSingleStoreMode()) ? $this->_storeManager->getStore()->getId() : null ; + $currentStore = $this->_storeManager->isSingleStoreMode() ? $this->_storeManager->getStore()->getId() : null; if ($onlyForCurrentStore) { foreach ($data as $row) { From 62bc03fa15aea7d0ca9021cbffb52abf574cd636 Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun Date: Sun, 18 Nov 2018 17:19:20 +0200 Subject: [PATCH 68/89] Fix the issue: Content overlaps the "close" button #19263 --- lib/web/css/source/components/_modals.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/web/css/source/components/_modals.less b/lib/web/css/source/components/_modals.less index fb29a74c60585..a8e8cebde3a6c 100644 --- a/lib/web/css/source/components/_modals.less +++ b/lib/web/css/source/components/_modals.less @@ -103,6 +103,10 @@ &.confirm { .modal-inner-wrap { .lib-css(width, @modal-popup-confirm__width); + + .modal-content { + padding-right: 7rem; + } } } From 740c0c60df1346a53ac84501dea447244bf1531a Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 19 Nov 2018 11:02:15 +0200 Subject: [PATCH 69/89] MAGETWO-93425: Permanent Redirect for old URL missing via API or no documentation --- app/code/Magento/CatalogUrlRewrite/composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index e373d8c8c1756..b4ceff96b50b7 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -16,6 +16,9 @@ "magento/module-ui": "*", "magento/module-url-rewrite": "*" }, + "suggest": { + "magento/module-webapi": "*" + }, "type": "magento2-module", "license": [ "OSL-3.0", From cb466f1df4bd6a513ec3f565431794c72fd281f4 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 19 Nov 2018 11:04:59 +0200 Subject: [PATCH 70/89] MAGETWO-93425: Permanent Redirect for old URL missing via API or no documentation --- .../Plugin/Webapi/Controller/Rest/InputParamsResolver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php b/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php index 5d1eff81874be..729c85fe858e2 100644 --- a/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php +++ b/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php @@ -26,7 +26,8 @@ class InputParamsResolver /** * @param RestRequest $request */ - public function __construct(RestRequest $request) { + public function __construct(RestRequest $request) + { $this->request = $request; } @@ -47,7 +48,6 @@ public function afterResolve(\Magento\Webapi\Controller\Rest\InputParamsResolver if ($this->isProductSaveCalled($serviceClassName, $serviceMethodName) && $this->isCustomOptionExists($requestBodyParams)) { - foreach ($requestBodyParams['product']['custom_attributes'] as $attribute) { if ($attribute['attribute_code'] === 'save_rewrites_history') { foreach ($result as $resultItem) { From 9e9c74c7b3b1e39112a5179da02db3948dc802c9 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets Date: Mon, 19 Nov 2018 12:24:14 +0200 Subject: [PATCH 71/89] Update _notifications.less --- .../css/source/module/header/actions-group/_notifications.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less index 93fc0d3eb4948..ceeb8d8eeb2b3 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less @@ -103,7 +103,8 @@ padding: .3em .5em; position: absolute; top: 50%; - width: 18px; + min-width: 18px; + height: 18px; } } From 52fabb91d0b11dd15050cb5c14babe0a6950f686 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Mon, 19 Nov 2018 13:25:52 +0200 Subject: [PATCH 72/89] MAGETWO-93425: Permanent Redirect for old URL missing via API or no documentation --- .../Plugin/Webapi/Controller/Rest/InputParamsResolver.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php b/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php index 729c85fe858e2..4e8e3840693a5 100644 --- a/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php +++ b/app/code/Magento/CatalogUrlRewrite/Plugin/Webapi/Controller/Rest/InputParamsResolver.php @@ -47,7 +47,7 @@ public function afterResolve(\Magento\Webapi\Controller\Rest\InputParamsResolver $requestBodyParams = $this->request->getBodyParams(); if ($this->isProductSaveCalled($serviceClassName, $serviceMethodName) - && $this->isCustomOptionExists($requestBodyParams)) { + && $this->isCustomAttributesExists($requestBodyParams)) { foreach ($requestBodyParams['product']['custom_attributes'] as $attribute) { if ($attribute['attribute_code'] === 'save_rewrites_history') { foreach ($result as $resultItem) { @@ -56,6 +56,7 @@ public function afterResolve(\Magento\Webapi\Controller\Rest\InputParamsResolver break 2; } } + break; } } } @@ -80,7 +81,7 @@ private function isProductSaveCalled(string $serviceClassName, string $serviceMe * @param array $requestBodyParams * @return bool */ - private function isCustomOptionExists(array $requestBodyParams): bool + private function isCustomAttributesExists(array $requestBodyParams): bool { return !empty($requestBodyParams['product']['custom_attributes']); } From 5016ad6e4554e90d46f8d6cc9390d5a1d5e45f7c Mon Sep 17 00:00:00 2001 From: Vincent MARMIESSE Date: Tue, 20 Nov 2018 13:02:16 +0100 Subject: [PATCH 73/89] Remove checkout edit link extra space --- .../templates/cart/item/renderer/actions/edit.phtml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/item/renderer/actions/edit.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/item/renderer/actions/edit.phtml index 1876cf2edb786..da0a83f05ef60 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/item/renderer/actions/edit.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/item/renderer/actions/edit.phtml @@ -12,8 +12,6 @@ - - - - + + From 0a2a61a029c1eab6084a1fb840e6208d0f7f8963 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Tue, 20 Nov 2018 14:09:51 +0200 Subject: [PATCH 74/89] Fix static tests --- .../Magento/PageCache/view/frontend/web/js/page-cache.js | 8 +++++--- .../Magento_Checkout/web/css/source/module/_minicart.less | 2 +- .../Magento_MultipleWishlist/web/css/source/_module.less | 8 ++++---- .../Magento_Checkout/web/css/source/module/_minicart.less | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js index 11707ea491fb5..c391b2c3aa72f 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js @@ -36,7 +36,9 @@ define([ * @returns {Array} */ $.fn.comments = function () { - var elements = []; + var elements = [], + contents, + elementContents; /** * @param {jQuery} element - Comment holder @@ -55,7 +57,7 @@ define([ } // rewrite jQuery contents() - var contents = function (element) { + contents = function (element) { return $.map(element, function (elem) { try { return $.nodeName(elem, "iframe") ? @@ -68,7 +70,7 @@ define([ }); }; - var elementContents = contents($(element)); + elementContents = contents($(element)); $.each(elementContents, function (index, el) { switch (el.nodeType) { diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less index d7ff3ba1e5732..673131563417d 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less @@ -107,7 +107,7 @@ @_toggle-selector: ~'.action.showcart', @_options-selector: ~'.block-minicart', @_dropdown-list-width: 320px, - @_dropdown-list-position-right: 0px, + @_dropdown-list-position-right: 0, @_dropdown-list-pointer-position: right, @_dropdown-list-pointer-position-left-right: 26px, @_dropdown-list-z-index: 101, diff --git a/app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less index cb341f3f479ba..2761a2f74f990 100644 --- a/app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less @@ -389,16 +389,16 @@ .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { .wishlist { &.window.popup { + .field { + .lib-form-field-type-revert(@_type: block); + } + bottom: auto; .lib-css(top, @desktop-popup-position-top); .lib-css(left, @desktop-popup-position-left); .lib-css(margin-left, @desktop-popup-margin-left); .lib-css(width, @desktop-popup-width); right: auto; - - .field { - .lib-form-field-type-revert(@_type: block); - } } } diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index 17fbdc8ba495b..9576004421e48 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -110,7 +110,7 @@ @_toggle-selector: ~'.action.showcart', @_options-selector: ~'.block-minicart', @_dropdown-list-width: 320px, - @_dropdown-list-position-right: 0px, + @_dropdown-list-position-right: 0, @_dropdown-list-pointer-position: right, @_dropdown-list-pointer-position-left-right: 26px, @_dropdown-list-z-index: 101, From aa8e5d54665d435a613b093e8dfe83a741dd9c35 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Tue, 20 Nov 2018 15:41:30 +0200 Subject: [PATCH 75/89] Fix static tests --- .../view/frontend/web/js/page-cache.js | 16 ++++++++++------ app/code/Magento/Sales/Block/Order/Items.php | 17 ++++++++++------- .../Magento/Framework/Locale/Config.php | 3 +++ .../Framework/View/Layout/Generator/Block.php | 4 +--- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js index c391b2c3aa72f..3789359696605 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js @@ -56,13 +56,17 @@ define([ } } - // rewrite jQuery contents() - contents = function (element) { - return $.map(element, function (elem) { + /** + * Rewrite jQuery contents(). + * + * @param {jQuery} elem + */ + contents = function (elem) { + return $.map(elem, function (el) { try { - return $.nodeName(elem, "iframe") ? - elem.contentDocument || (elem.contentWindow ? elem.contentWindow.document : []) : - $.merge([], elem.childNodes); + return $.nodeName(el, "iframe") ? + el.contentDocument || (el.contentWindow ? el.contentWindow.document : []) : + $.merge([], el.childNodes); } catch (e) { consoleLogger.error(e); return []; diff --git a/app/code/Magento/Sales/Block/Order/Items.php b/app/code/Magento/Sales/Block/Order/Items.php index 0b67e9a0746d3..d7255a24aead5 100644 --- a/app/code/Magento/Sales/Block/Order/Items.php +++ b/app/code/Magento/Sales/Block/Order/Items.php @@ -5,13 +5,13 @@ */ /** - * Sales order view items block - * * @author Magento Core Team */ namespace Magento\Sales\Block\Order; /** + * Sales order view items block. + * * @api * @since 100.0.2 */ @@ -86,8 +86,9 @@ protected function _prepareLayout() } /** - * Determine if the pager should be displayed for order items list - * To be called from templates(after _prepareLayout()) + * Determine if the pager should be displayed for order items list. + * + * To be called from templates(after _prepareLayout()). * * @return bool * @since 100.1.7 @@ -100,7 +101,8 @@ public function isPagerDisplayed() /** * Get visible items for current page. - * To be called from templates(after _prepareLayout()) + * + * To be called from templates(after _prepareLayout()). * * @return \Magento\Framework\DataObject[] * @since 100.1.7 @@ -111,8 +113,9 @@ public function getItems() } /** - * Get pager HTML according to our requirements - * To be called from templates(after _prepareLayout()) + * Get pager HTML according to our requirements. + * + * To be called from templates(after _prepareLayout()). * * @return string HTML output * @since 100.1.7 diff --git a/lib/internal/Magento/Framework/Locale/Config.php b/lib/internal/Magento/Framework/Locale/Config.php index 790fa9c924c8e..fe685fdf35b73 100644 --- a/lib/internal/Magento/Framework/Locale/Config.php +++ b/lib/internal/Magento/Framework/Locale/Config.php @@ -5,6 +5,9 @@ */ namespace Magento\Framework\Locale; +/** + * Allowed locale and currency configuration. + */ class Config implements \Magento\Framework\Locale\ConfigInterface { /** diff --git a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php index f0e62fce2a7ce..39da65a2d1f3d 100755 --- a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php +++ b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php @@ -103,9 +103,7 @@ public function __construct( } /** - * {@inheritdoc} - * - * @return string + * @inheritdoc */ public function getType() { From 2aa7ad274cbc919530210f2c09db2515744b0af8 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Tue, 20 Nov 2018 16:13:24 +0200 Subject: [PATCH 76/89] Fix static tests --- app/code/Magento/PageCache/view/frontend/web/js/page-cache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js index 3789359696605..144e20f2e728d 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js @@ -64,7 +64,7 @@ define([ contents = function (elem) { return $.map(elem, function (el) { try { - return $.nodeName(el, "iframe") ? + return $.nodeName(el, 'iframe') ? el.contentDocument || (el.contentWindow ? el.contentWindow.document : []) : $.merge([], el.childNodes); } catch (e) { From 0e6409db3ec5aa282ff1cf53083a059724fe96ef Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Tue, 20 Nov 2018 17:00:25 +0200 Subject: [PATCH 77/89] Fix static tests --- app/code/Magento/PageCache/view/frontend/web/js/page-cache.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js index 144e20f2e728d..2e8a4769be10b 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/page-cache.js @@ -69,6 +69,7 @@ define([ $.merge([], el.childNodes); } catch (e) { consoleLogger.error(e); + return []; } }); From a35c21f4e2341ce938ef02eafe11f8365a5c98ef Mon Sep 17 00:00:00 2001 From: Dmytro Drozd Date: Wed, 21 Nov 2018 12:14:10 +0200 Subject: [PATCH 78/89] Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MAGETWO-96024 # Conflicts: # app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml --- .../Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml index 8109230a364ad..fd1b6add8391f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml @@ -234,6 +234,7 @@ + From 969f2c2ddb2998c8ecf1cea312e3c483e3549e5c Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun Date: Wed, 21 Nov 2018 14:39:46 +0200 Subject: [PATCH 79/89] Fix the issue with repetitive "tbody" tag for order items table --- .../Magento/Sales/view/frontend/templates/order/items.phtml | 5 +++-- .../Magento/luma/Magento_Sales/web/css/source/_module.less | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Sales/view/frontend/templates/order/items.phtml b/app/code/Magento/Sales/view/frontend/templates/order/items.phtml index e43d32760febb..dc179b6ee4ac1 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/items.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/items.phtml @@ -29,9 +29,10 @@ getItems(); ?> + getParentItem()) continue; ?> - + getItemHtml($item) ?> helper('Magento\GiftMessage\Helper\Message')->isMessagesAllowed('order_item', $item) && $item->getGiftMessageId()): ?> helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($item); ?> @@ -62,8 +63,8 @@ - + isPagerDisplayed()): ?> diff --git a/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_module.less index a0f734b05cbd1..1e4a92fa0701f 100644 --- a/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Sales/web/css/source/_module.less @@ -612,10 +612,6 @@ padding: 25px; .col { - &.name { - padding-left: 0; - } - &.price { text-align: center; } From ba006c02d3bc7dc0dc71553c991f66b6364f138d Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Wed, 21 Nov 2018 18:02:08 +0100 Subject: [PATCH 80/89] Removed $this->setShowGlobalIcon(); --- app/code/Magento/Backend/Block/Widget/Form.php | 1 - .../Product/Edit/Action/Attribute/Tab/Attributes.php | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/app/code/Magento/Backend/Block/Widget/Form.php b/app/code/Magento/Backend/Block/Widget/Form.php index 59b5cc060cc05..38d5d90a22d15 100644 --- a/app/code/Magento/Backend/Block/Widget/Form.php +++ b/app/code/Magento/Backend/Block/Widget/Form.php @@ -59,7 +59,6 @@ protected function _construct() parent::_construct(); $this->setDestElementId('edit_form'); - $this->setShowGlobalIcon(false); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php index a08142c10be5e..2df0ff0b6cd7c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php @@ -64,17 +64,6 @@ public function __construct( parent::__construct($context, $registry, $formFactory, $data); } - /** - * Construct block - * - * @return void - */ - protected function _construct() - { - parent::_construct(); - $this->setShowGlobalIcon(true); - } - /** * Prepares form * From bf346d176cdebdb3bb98c8248eb56787c110bbda Mon Sep 17 00:00:00 2001 From: Alexandr Voronoy Date: Thu, 22 Nov 2018 00:11:58 +0200 Subject: [PATCH 81/89] Changed schema input and output, fixed bug with uniq type --- .../SendFriendGraphQl/etc/schema.graphqls | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls b/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls index 3915d48681ab1..14f73a034a7ea 100644 --- a/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls @@ -2,27 +2,38 @@ # See COPYING.txt for license details. type Mutation { - sendEmailToFriend (input: SendEmailToFriendSenderInput): SendEmailToFriendOutput @resolver(class: "\\Magento\\SendFriendGraphQl\\Model\\Resolver\\SendEmailToFriend") @doc(description:"Recommends Product by Sending Single/Multiple Email") + sendEmailToFriend (input: SendEmailToFriendInput): SendEmailToFriendOutput @resolver(class: "\\Magento\\SendFriendGraphQl\\Model\\Resolver\\SendEmailToFriend") @doc(description:"Recommends Product by Sending Single/Multiple Email") +} + +input SendEmailToFriendInput { + product_id: Int! + sender: SendEmailToFriendSenderInput! + recipients: [SendEmailToFriendRecipientInput!]! } input SendEmailToFriendSenderInput { - product_id: Int! - sender: Sender! - recipients: [Recipient!]! + name: String! + email: String! + message: String! } -type Sender { +input SendEmailToFriendRecipientInput { + name: String! + email: String! +} + +type SendEmailToFriendSender { name: String! email: String! message: String! } -type Recipient { +type SendEmailToFriendRecipient { name: String! email: String! } type SendEmailToFriendOutput { - sender: Sender - recipients: [Recipient] -} + sender: SendEmailToFriendSender + recipients: [SendEmailToFriendRecipient] +} \ No newline at end of file From 38c1c330b9e55c6f098c40b642343b8dd39179e7 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Thu, 22 Nov 2018 09:50:38 +0100 Subject: [PATCH 82/89] fix: remove old code in tabs, always set tabindex to 0 when tabs are initialized --- lib/web/mage/tabs.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/web/mage/tabs.js b/lib/web/mage/tabs.js index e7e04a26b29c1..b441477ab8d8a 100644 --- a/lib/web/mage/tabs.js +++ b/lib/web/mage/tabs.js @@ -83,7 +83,7 @@ define([ /** * When the widget gets instantiated, the first tab that is not disabled receive focusable property - * Updated: for accessibility all tabs receive tabIndex 0 + * All tabs receive tabIndex 0 * @private */ _processTabIndex: function () { @@ -91,17 +91,8 @@ define([ self.triggers.attr('tabIndex', 0); $.each(this.collapsibles, function (i) { - if (!$(this).collapsible('option', 'disabled')) { - self.triggers.eq(i).attr('tabIndex', 0); - - return false; - } - }); - $.each(this.collapsibles, function (i) { - $(this).on('beforeOpen', function () { - self.triggers.attr('tabIndex', 0); - self.triggers.eq(i).attr('tabIndex', 0); - }); + self.triggers.attr('tabIndex', 0); + self.triggers.eq(i).attr('tabIndex', 0); }); }, From 922d398fdbaba69ad54ace1d3291f851e6f33aa7 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Thu, 22 Nov 2018 15:14:22 +0200 Subject: [PATCH 83/89] GraphQL-176: Show only active CMS Blocks --- .../CmsGraphQl/Model/Resolver/Blocks.php | 27 +++++-------------- .../Model/Resolver/DataProvider/Block.php | 4 ++- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php b/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php index fabb479763e60..2f1c84848eb52 100644 --- a/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php +++ b/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php @@ -14,7 +14,6 @@ use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Psr\Log\LoggerInterface; /** * CMS blocks field resolver, used for GraphQL request processing @@ -26,20 +25,13 @@ class Blocks implements ResolverInterface */ private $blockDataProvider; - /** - * @var LoggerInterface - */ - private $logger; - /** * @param BlockDataProvider $blockDataProvider */ public function __construct( - BlockDataProvider $blockDataProvider, - LoggerInterface $logger + BlockDataProvider $blockDataProvider ) { $this->blockDataProvider = $blockDataProvider; - $this->logger = $logger; } /** @@ -84,19 +76,12 @@ private function getBlockIdentifiers(array $args): array private function getBlocksData(array $blockIdentifiers): array { $blocksData = []; - try { - foreach ($blockIdentifiers as $blockIdentifier) { - $blockData = $this->blockDataProvider->getData($blockIdentifier); - if (!empty($blockData)) { - $blocksData[$blockIdentifier] = $blockData; - } else { - $this->logger->warning( - sprintf('The CMS block with the "%s" Identifier is disabled.', $blockIdentifier) - ); - } + foreach ($blockIdentifiers as $blockIdentifier) { + try { + $blocksData[$blockIdentifier] = $this->blockDataProvider->getData($blockIdentifier); + } catch (NoSuchEntityException $e) { + $blocksData[$blockIdentifier] = new GraphQlNoSuchEntityException(__($e->getMessage()), $e); } - } catch (NoSuchEntityException $e) { - throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e); } return $blocksData; } diff --git a/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php b/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php index d47a0dca27157..c1a694dcd73b7 100644 --- a/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php +++ b/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php @@ -49,7 +49,9 @@ public function getData(string $blockIdentifier): array $block = $this->blockRepository->getById($blockIdentifier); if (false === $block->isActive()) { - return []; + throw new NoSuchEntityException( + __('The CMS block with the "%1" ID doesn\'t exist.', $blockIdentifier) + ); } $renderedContent = $this->widgetFilter->filter($block->getContent()); From 6d984eb0ff9d596ece553ff50d77d68c6749ff33 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Thu, 22 Nov 2018 16:29:17 +0200 Subject: [PATCH 84/89] GraphQL-176: Show only active CMS Blocks --- .../TestFramework/TestCase/GraphQl/Client.php | 5 +- .../ResponseContainsErrorsException.php | 41 +++++++ .../Magento/GraphQl/Cms/CmsBlockTest.php | 116 +++++++++++------- .../testsuite/Magento/Cms/_files/blocks.php | 52 ++++++++ .../Magento/Cms/_files/blocks_rollback.php | 23 ++++ 5 files changed, 192 insertions(+), 45 deletions(-) create mode 100644 dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/ResponseContainsErrorsException.php create mode 100644 dev/tests/integration/testsuite/Magento/Cms/_files/blocks.php create mode 100644 dev/tests/integration/testsuite/Magento/Cms/_files/blocks_rollback.php diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php index 64ad44528572d..d34a72707b89e 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php @@ -102,7 +102,10 @@ private function processErrors($responseBodyArray) } } - throw new \Exception('GraphQL response contains errors: ' . $errorMessage); + throw new ResponseContainsErrorsException( + 'GraphQL response contains errors: ' . $errorMessage, + $responseBodyArray + ); } throw new \Exception('GraphQL responded with an unknown error: ' . json_encode($responseBodyArray)); } diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/ResponseContainsErrorsException.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/ResponseContainsErrorsException.php new file mode 100644 index 0000000000000..568de57543d84 --- /dev/null +++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/ResponseContainsErrorsException.php @@ -0,0 +1,41 @@ +responseData = $responseData; + } + + /** + * Get response data + * + * @return array + */ + public function getResponseData(): array + { + return $this->responseData; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php index d8e06fd08385c..57f526b1cb2f7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php @@ -7,43 +7,45 @@ namespace Magento\GraphQl\Cms; -use Magento\Cms\Model\Block; -use Magento\Cms\Model\GetBlockByIdentifier; -use Magento\Store\Model\StoreManagerInterface; +use Magento\Cms\Api\BlockRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQl\ResponseContainsErrorsException; use Magento\TestFramework\TestCase\GraphQlAbstract; use Magento\Widget\Model\Template\FilterEmulate; class CmsBlockTest extends GraphQlAbstract { /** - * @var \Magento\TestFramework\ObjectManager + * @var BlockRepositoryInterface */ - private $objectManager; + private $blockRepository; + + /** + * @var FilterEmulate + */ + private $filterEmulate; protected function setUp() { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->blockRepository = Bootstrap::getObjectManager()->get(BlockRepositoryInterface::class); + $this->filterEmulate = Bootstrap::getObjectManager()->get(FilterEmulate::class); } /** * Verify the fields of CMS Block selected by identifiers * - * @magentoApiDataFixture Magento/Cms/_files/block.php + * @magentoApiDataFixture Magento/Cms/_files/blocks.php */ - public function testGetCmsBlocksByIdentifiers() + public function testGetCmsBlock() { - /** @var StoreManagerInterface $storeManager */ - $storeManager = $this->objectManager->get(StoreManagerInterface::class); - $storeId = (int)$storeManager->getStore()->getId(); - $cmsBlock = $this->objectManager->get(GetBlockByIdentifier::class)->execute("fixture_block", $storeId); + $cmsBlock = $this->blockRepository->getById('enabled_block'); $cmsBlockData = $cmsBlock->getData(); - /** @var FilterEmulate $widgetFilter */ - $widgetFilter = $this->objectManager->get(FilterEmulate::class); - $renderedContent = $widgetFilter->setUseSessionInUrl(false)->filter($cmsBlock->getContent()); + $renderedContent = $this->filterEmulate->setUseSessionInUrl(false)->filter($cmsBlock->getContent()); + $query = <<graphQlQuery($query); - $this->assertArrayHasKey('cmsBlocks', $response); - $this->assertArrayHasKey('items', $response['cmsBlocks']); - $this->assertArrayHasKey('content', $response['cmsBlocks']['items'][0]); - $this->assertEquals($cmsBlockData['identifier'], $response['cmsBlocks']['items'][0]['identifier']); - $this->assertEquals($cmsBlockData['title'], $response['cmsBlocks']['items'][0]['title']); - $this->assertEquals($renderedContent, $response['cmsBlocks']['items'][0]['content']); + + self::assertArrayHasKey('cmsBlocks', $response); + self::assertArrayHasKey('items', $response['cmsBlocks']); + + self::assertEquals($cmsBlockData['identifier'], $response['cmsBlocks']['items'][0]['identifier']); + self::assertEquals($cmsBlockData['title'], $response['cmsBlocks']['items'][0]['title']); + self::assertEquals($renderedContent, $response['cmsBlocks']['items'][0]['content']); } /** * Verify the message when CMS Block is disabled * - * @magentoApiDataFixture Magento/Cms/_files/block.php + * @expectedException \Exception + * @expectedExceptionMessage The CMS block with the "disabled_block" ID doesn't exist + * + * @magentoApiDataFixture Magento/Cms/_files/blocks.php */ - public function testGetDisabledCmsBlockByIdentifiers() + public function testGetDisabledCmsBlock() { - /** @var StoreManagerInterface $storeManager */ - $storeManager = $this->objectManager->get(StoreManagerInterface::class); - $storeId = (int)$storeManager->getStore()->getId(); - $cmsBlockId = $this->objectManager->get(GetBlockByIdentifier::class) - ->execute("fixture_block", $storeId) - ->getId(); - $this->objectManager->get(Block::class)->load($cmsBlockId)->setIsActive(0)->save(); $query = <<expectException(\Exception::class); - $this->expectExceptionMessage('No such entity.'); $this->graphQlQuery($query); } /** * Verify the message when identifiers were not specified + * + * @expectedException \Exception + * @expectedExceptionMessage "identifiers" of CMS blocks should be specified */ - public function testGetCmsBlockBypassingIdentifiers() + public function testGetCmsBlocksWithoutIdentifiers() { $query = <<expectException(\Exception::class); - $this->expectExceptionMessage('"identifiers" of CMS blocks should be specified'); $this->graphQlQuery($query); } /** * Verify the message when CMS Block with such identifiers does not exist + * + * @expectedException \Exception + * @expectedExceptionMessage The CMS block with the "nonexistent_id" ID doesn't exist. */ public function testGetCmsBlockByNonExistentIdentifier() { $query = <<expectException(\Exception::class); - $this->expectExceptionMessage('The CMS block with the "0" ID doesn\'t exist.'); $this->graphQlQuery($query); } + + /** + * Verify the fields of CMS Block selected by identifiers + * + * @magentoApiDataFixture Magento/Cms/_files/blocks.php + */ + public function testGetEnabledAndDisabledCmsBlockInOneRequest() + { + $query = + <<graphQlQuery($query); + self::fail('Response should contains errors.'); + } catch (ResponseContainsErrorsException $e) { + $responseData = $e->getResponseData(); + } + + self::assertNotEmpty($responseData); + self::assertEquals('enabled_block', $responseData['data']['cmsBlocks']['items'][0]['identifier']); + self::assertEquals( + 'The CMS block with the "disabled_block" ID doesn\'t exist.', + $responseData['errors'][0]['message'] + ); + } } diff --git a/dev/tests/integration/testsuite/Magento/Cms/_files/blocks.php b/dev/tests/integration/testsuite/Magento/Cms/_files/blocks.php new file mode 100644 index 0000000000000..bbdc697645a42 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Cms/_files/blocks.php @@ -0,0 +1,52 @@ +get(BlockRepositoryInterface::class); +/** @var BlockInterfaceFactory $blockFactory */ +$blockFactory = Bootstrap::getObjectManager()->get(BlockInterfaceFactory::class); +$storeId = Bootstrap::getObjectManager()->get(StoreManagerInterface::class)->getStore()->getId(); + +/** @var BlockInterface $block */ +$block = $blockFactory->create([ + 'data' => [ + BlockInterface::IDENTIFIER => 'enabled_block', + BlockInterface::TITLE => 'Enabled CMS Block Title', + BlockInterface::CONTENT => ' +

Enabled Block

+ store url +

Config value: "{{config path="web/unsecure/base_url"}}".

+

Custom variable: "{{customvar code="variable_code"}}".

+ ', + BlockInterface::IS_ACTIVE => 1, + 'store_id' => [$storeId], + ] +]); +$blockRepository->save($block); + +/** @var BlockInterface $block */ +$block = $blockFactory->create([ + 'data' => [ + BlockInterface::IDENTIFIER => 'disabled_block', + BlockInterface::TITLE => 'Disabled CMS Block Title', + BlockInterface::CONTENT => ' +

Disabled Block

+ store url +

Config value: "{{config path="web/unsecure/base_url"}}".

+

Custom variable: "{{customvar code="variable_code"}}".

+ ', + BlockInterface::IS_ACTIVE => 0, + 'store_id' => [$storeId], + ] +]); +$blockRepository->save($block); diff --git a/dev/tests/integration/testsuite/Magento/Cms/_files/blocks_rollback.php b/dev/tests/integration/testsuite/Magento/Cms/_files/blocks_rollback.php new file mode 100644 index 0000000000000..a7a2a51524cf0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Cms/_files/blocks_rollback.php @@ -0,0 +1,23 @@ +get(BlockRepositoryInterface::class); + +foreach (['enabled_block', 'disabled_block'] as $blockId) { + try { + $blockRepository->deleteById($blockId); + } catch (NoSuchEntityException $e) { + /** + * Tests which are wrapped with MySQL transaction clear all data by transaction rollback. + */ + } +} From 6e32307e48656413d3f396db180e92288ce7a017 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Thu, 22 Nov 2018 16:43:01 +0200 Subject: [PATCH 85/89] GraphQL-260: Fixed bug with uniq type --- app/code/Magento/SendFriendGraphQl/etc/schema.graphqls | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls b/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls index 14f73a034a7ea..1234b65a7b910 100644 --- a/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls @@ -22,6 +22,11 @@ input SendEmailToFriendRecipientInput { email: String! } +type SendEmailToFriendOutput { + sender: SendEmailToFriendSender + recipients: [SendEmailToFriendRecipient] +} + type SendEmailToFriendSender { name: String! email: String! @@ -32,8 +37,3 @@ type SendEmailToFriendRecipient { name: String! email: String! } - -type SendEmailToFriendOutput { - sender: SendEmailToFriendSender - recipients: [SendEmailToFriendRecipient] -} \ No newline at end of file From d3a22e9e7a10f069989b633f3b5fffe09b6ec8d2 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Thu, 22 Nov 2018 16:48:53 +0200 Subject: [PATCH 86/89] GraphQL-176: Show only active CMS Blocks -- Fix static tests --- app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php | 4 ++++ .../Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php | 2 ++ .../Magento/TestFramework/TestCase/GraphQl/Client.php | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php b/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php index 2f1c84848eb52..e55db2a3fa42a 100644 --- a/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php +++ b/app/code/Magento/CmsGraphQl/Model/Resolver/Blocks.php @@ -55,6 +55,8 @@ public function resolve( } /** + * Get block identifiers + * * @param array $args * @return string[] * @throws GraphQlInputException @@ -69,6 +71,8 @@ private function getBlockIdentifiers(array $args): array } /** + * Get blocks data + * * @param array $blockIdentifiers * @return array * @throws GraphQlNoSuchEntityException diff --git a/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php b/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php index c1a694dcd73b7..47a2439c4fad0 100644 --- a/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php +++ b/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php @@ -40,6 +40,8 @@ public function __construct( } /** + * Get block data + * * @param string $blockIdentifier * @return array * @throws NoSuchEntityException diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php index d34a72707b89e..e94cc9613b1c9 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php @@ -29,8 +29,6 @@ class Client private $json; /** - * CurlClient constructor. - * * @param CurlClient|null $curlClient * @param JsonSerializer|null $json */ @@ -81,6 +79,8 @@ public function postQuery(string $query, array $variables = [], string $operatio } /** + * Process errors + * * @param array $responseBodyArray * @throws \Exception */ From 772d4da83ee63044a64ad49e19c8052f6f54e109 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Thu, 22 Nov 2018 16:58:41 +0200 Subject: [PATCH 87/89] GraphQL-176: Show only active CMS Blocks -- Fix static tests --- .../framework/Magento/TestFramework/TestCase/GraphQl/Client.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php index e94cc9613b1c9..5458b5cfbb731 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php @@ -112,6 +112,8 @@ private function processErrors($responseBodyArray) } /** + * Get endpoint url + * * @return string resource URL * @throws \Exception */ From 492e26426d89d139c2e565f4cf095ff7afeb651d Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Thu, 22 Nov 2018 17:53:23 +0200 Subject: [PATCH 88/89] magento-engcom/magento2ce#2354: Fixed Code Style Issues --- .../Block/Product/ProductList/Crosssell.php | 4 ++++ .../Block/Product/ProductList/Related.php | 6 ++++++ .../Block/Product/ProductList/Upsell.php | 21 +++++++++++++++++++ .../Controller/Adminhtml/History/Download.php | 4 +++- .../Model/Plugin/CustomerPlugin.php | 3 +++ .../Review/Model/ResourceModel/Rating.php | 9 ++++++++ .../header/actions-group/_notifications.less | 4 ++-- 7 files changed, 48 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php index 043704a9f2bca..596cd7cc5bdce 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php @@ -9,6 +9,9 @@ */ namespace Magento\Catalog\Block\Product\ProductList; +/** + * Crosssell block for product + */ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct { /** @@ -43,6 +46,7 @@ protected function _prepareData() /** * Before rendering html process + * * Prepare items collection * * @return \Magento\Catalog\Block\Product\ProductList\Crosssell diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php index 91e4161ce53b1..6de70bb971367 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php @@ -77,6 +77,8 @@ public function __construct( } /** + * Prepare data + * * @return $this */ protected function _prepareData() @@ -103,6 +105,8 @@ protected function _prepareData() } /** + * Before to html handler + * * @return $this */ protected function _beforeToHtml() @@ -112,6 +116,8 @@ protected function _beforeToHtml() } /** + * Get collection items + * * @return Collection */ public function getItems() diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index ef38693a5454c..24822447ae915 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -91,6 +91,8 @@ public function __construct( } /** + * Prepare data + * * @return $this */ protected function _prepareData() @@ -121,6 +123,8 @@ protected function _prepareData() } /** + * Before to html handler + * * @return $this */ protected function _beforeToHtml() @@ -130,6 +134,8 @@ protected function _beforeToHtml() } /** + * Get items collection + * * @return Collection */ public function getItemCollection() @@ -145,6 +151,8 @@ public function getItemCollection() } /** + * Get collection items + * * @return \Magento\Framework\DataObject[] */ public function getItems() @@ -156,6 +164,8 @@ public function getItems() } /** + * Get row count + * * @return float */ public function getRowCount() @@ -164,6 +174,8 @@ public function getRowCount() } /** + * Set column count + * * @param string $columns * @return $this */ @@ -176,6 +188,8 @@ public function setColumnCount($columns) } /** + * Get column count + * * @return int */ public function getColumnCount() @@ -184,6 +198,8 @@ public function getColumnCount() } /** + * Reset items iterator + * * @return void */ public function resetItemsIterator() @@ -193,6 +209,8 @@ public function resetItemsIterator() } /** + * Get iterable item + * * @return mixed */ public function getIterableItem() @@ -204,6 +222,7 @@ public function getIterableItem() /** * Set how many items we need to show in upsell block + * * Notice: this parameter will be also applied * * @param string $type @@ -219,6 +238,8 @@ public function setItemLimit($type, $limit) } /** + * Get item limit + * * @param string $type * @return array|int */ diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php b/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php index d46fda9a1c0ef..ba37cc8aacff9 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php @@ -1,6 +1,5 @@ Date: Fri, 23 Nov 2018 17:48:08 +0200 Subject: [PATCH 89/89] MAGETWO-96024: PR stabilization --- ...dPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml index a8b2df1fcfa67..f283a040ced41 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml @@ -59,6 +59,7 @@ +