From 1d543e6af1ff8f42f635d3913f619a7e5e04a7b5 Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Mon, 9 Apr 2018 10:40:41 -0500 Subject: [PATCH 01/95] MAGETWO-90049: Static test failed on phtml files - Added *.phtml files to exclusion list for PSR2 end tag static test. --- dev/tests/static/framework/Magento/ruleset.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/tests/static/framework/Magento/ruleset.xml b/dev/tests/static/framework/Magento/ruleset.xml index 14d05b466b407..94f843fcdf43e 100644 --- a/dev/tests/static/framework/Magento/ruleset.xml +++ b/dev/tests/static/framework/Magento/ruleset.xml @@ -10,6 +10,10 @@ + + *.phtml + + From e151f20fcbd68491bbeb63c1ed396a45da93036a Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Mon, 7 May 2018 15:31:55 +0300 Subject: [PATCH 02/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- .../Console/Command/GeneratePatchCommand.php | 2 +- .../Command/TablesWhitelistGenerateCommand.php | 2 +- .../etc/install-config-mysql.php.dist | 4 ++-- .../Setup/Declaration/Schema/Request.php | 2 +- .../Setup/Console/Command/InstallCommand.php | 6 +++--- .../Setup/Console/Command/UpgradeCommand.php | 7 +++++++ .../Unit/Console/Command/UpgradeCommandTest.php | 16 ++++++++-------- 7 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php b/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php index cc3760b6846d7..1cc76ed41d4fb 100644 --- a/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php +++ b/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php @@ -25,7 +25,7 @@ class GeneratePatchCommand extends Command /** * Command arguments and options */ - const COMMAND_NAME = 'dev:generate:patch'; + const COMMAND_NAME = 'setup:db-declaration:generate-patch'; const MODULE_NAME = 'module'; const INPUT_KEY_IS_REVERTABLE = 'revertable'; const INPUT_KEY_PATCH_TYPE = 'type'; diff --git a/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php b/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php index 6715ecd681efe..e24fea6a11e39 100644 --- a/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php +++ b/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php @@ -72,7 +72,7 @@ public function __construct( */ protected function configure() { - $this->setName('declaration:generate:whitelist') + $this->setName('setup:db-declaration:generate-whitelist') ->setDescription( 'Generate whitelist of tables and columns that are allowed to be edited by declaration installer' ) diff --git a/dev/tests/setup-integration/etc/install-config-mysql.php.dist b/dev/tests/setup-integration/etc/install-config-mysql.php.dist index c5757b0011060..d355100c446be 100644 --- a/dev/tests/setup-integration/etc/install-config-mysql.php.dist +++ b/dev/tests/setup-integration/etc/install-config-mysql.php.dist @@ -17,8 +17,8 @@ return [ 'admin-email' => \Magento\TestFramework\Bootstrap::ADMIN_EMAIL, 'admin-firstname' => \Magento\TestFramework\Bootstrap::ADMIN_FIRSTNAME, 'admin-lastname' => \Magento\TestFramework\Bootstrap::ADMIN_LASTNAME, - 'enable_modules' => 'Magento_TestSetupModule2,Magento_TestSetupModule1,Magento_Backend', - 'disable_modules' => 'all' + 'enable-modules' => 'Magento_TestSetupModule2,Magento_TestSetupModule1,Magento_Backend', + 'disable-modules' => 'all' ], 'checkout' => [ 'host' => '{{db-host}}', diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Request.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Request.php index 2ffe29cc76962..9271e6834945f 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Request.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Request.php @@ -14,7 +14,7 @@ class Request /** * Option to enable dump functionality for safe mode. */ - const DUMP_ENABLE_OPTIONS = "dump_enable"; + const DUMP_ENABLE_OPTIONS = "dump"; /** * @var bool diff --git a/setup/src/Magento/Setup/Console/Command/InstallCommand.php b/setup/src/Magento/Setup/Console/Command/InstallCommand.php index 65eb047a5c77e..80e2732d8357e 100644 --- a/setup/src/Magento/Setup/Console/Command/InstallCommand.php +++ b/setup/src/Magento/Setup/Console/Command/InstallCommand.php @@ -45,20 +45,20 @@ class InstallCommand extends AbstractSetupCommand * List of comma-separated module names. That must be enabled during installation. * Available magic param all. */ - const INPUT_KEY_ENABLE_MODULES = 'enable_modules'; + const INPUT_KEY_ENABLE_MODULES = 'enable-modules'; /** * List of comma-separated module names. That must be avoided during installation. * List of comma-separated module names. That must be avoided during installation. * Avaiable magic param all. */ - const INPUT_KEY_DISABLE_MODULES = 'disable_modules'; + const INPUT_KEY_DISABLE_MODULES = 'disable-modules'; /** * If this flag is enabled, than all your old scripts with format: * InstallSchema, UpgradeSchema will be converted to new db_schema.xml format. */ - const CONVERT_OLD_SCRIPTS_KEY = 'convert_old_scripts'; + const CONVERT_OLD_SCRIPTS_KEY = 'convert-old-scripts'; /** * Parameter indicating command for interactive setup diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index bd7be01a0b2fe..ea67d69f537ce 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -12,6 +12,7 @@ use Magento\Framework\Setup\ConsoleLogger; use Magento\Framework\Setup\Declaration\Schema\DryRunLogger; use Magento\Framework\Setup\Declaration\Schema\OperationsExecutor; +use Magento\Framework\Setup\Declaration\Schema\Request; use Magento\Setup\Model\InstallerFactory; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; @@ -103,6 +104,12 @@ protected function configure() 'Magento Installation will be run in dry-run mode', false ), + new InputOption( + Request::DUMP_ENABLE_OPTIONS, + null, + InputOption::VALUE_REQUIRED, + 'Should removed columns be dumped or recovered columns data reverted.' + ), ]; $this->setName('setup:upgrade') ->setDescription('Upgrades the Magento application, DB data, and schema') diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php index 6f32a68682606..36e7177ee3886 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php @@ -104,14 +104,14 @@ public function executeDataProvider() [ 'options' => [ '--magento-init-params' => '', - '--convert_old_scripts' => false, + '--convert-old-scripts' => false, ], 'deployMode' => \Magento\Framework\App\State::MODE_PRODUCTION, 'expectedString' => 'Please re-run Magento compile command. Use the command "setup:di:compile"' . PHP_EOL, 'expectedOptions' => [ 'keep-generated' => false, - 'convert_old_scripts' => false, + 'convert-old-scripts' => false, 'magento-init-params' => '', 'safe-mode' => false, 'data-restore' => false, @@ -121,14 +121,14 @@ public function executeDataProvider() [ 'options' => [ '--magento-init-params' => '', - '--convert_old_scripts' => false, + '--convert-old-scripts' => false, '--keep-generated' => true, ], 'deployMode' => \Magento\Framework\App\State::MODE_PRODUCTION, 'expectedString' => '', 'expectedOptions' => [ 'keep-generated' => true, - 'convert_old_scripts' => false, + 'convert-old-scripts' => false, 'magento-init-params' => '', 'safe-mode' => false, 'data-restore' => false, @@ -136,12 +136,12 @@ public function executeDataProvider() ] ], [ - 'options' => ['--magento-init-params' => '', '--convert_old_scripts' => false], + 'options' => ['--magento-init-params' => '', '--convert-old-scripts' => false], 'deployMode' => \Magento\Framework\App\State::MODE_DEVELOPER, 'expectedString' => '', 'expectedOptions' => [ 'keep-generated' => false, - 'convert_old_scripts' => false, + 'convert-old-scripts' => false, 'magento-init-params' => '', 'safe-mode' => false, 'data-restore' => false, @@ -149,12 +149,12 @@ public function executeDataProvider() ] ], [ - 'options' => ['--magento-init-params' => '', '--convert_old_scripts' => false], + 'options' => ['--magento-init-params' => '', '--convert-old-scripts' => false], 'deployMode' => \Magento\Framework\App\State::MODE_DEFAULT, 'expectedString' => '', 'expectedOptions' => [ 'keep-generated' => false, - 'convert_old_scripts' => false, + 'convert-old-scripts' => false, 'magento-init-params' => '', 'safe-mode' => false, 'data-restore' => false, From 5105d01a043705b1ca8df10b6aaaaa4606059551 Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Wed, 16 May 2018 12:51:59 +0300 Subject: [PATCH 03/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- setup/src/Magento/Setup/Model/Installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/src/Magento/Setup/Model/Installer.php b/setup/src/Magento/Setup/Model/Installer.php index a7dc4dd1e6099..e14819288e10d 100644 --- a/setup/src/Magento/Setup/Model/Installer.php +++ b/setup/src/Magento/Setup/Model/Installer.php @@ -423,8 +423,8 @@ private function createModulesConfig($request, $dryRun = false) $deploymentConfig = $this->deploymentConfigReader->load(); $currentModules = isset($deploymentConfig[ConfigOptionsListConstants::KEY_MODULES]) ? $deploymentConfig[ConfigOptionsListConstants::KEY_MODULES] : []; - $enable = $this->readListOfModules($all, $request, self::ENABLE_MODULES); - $disable = $this->readListOfModules($all, $request, self::DISABLE_MODULES); + $enable = $this->readListOfModules($all, $request, InstallCommand::INPUT_KEY_ENABLE_MODULES); + $disable = $this->readListOfModules($all, $request, InstallCommand::INPUT_KEY_DISABLE_MODULES); $result = []; foreach ($all as $module) { if ((isset($currentModules[$module]) && !$currentModules[$module])) { From 27c02692687e37c9da92765e9b8e5b09b4e8c4b3 Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Wed, 16 May 2018 12:57:44 +0300 Subject: [PATCH 04/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- .../Test/Unit/Console/Command/UpgradeCommandTest.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php index 36e7177ee3886..4b8b22315ba64 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php @@ -112,10 +112,11 @@ public function executeDataProvider() 'expectedOptions' => [ 'keep-generated' => false, 'convert-old-scripts' => false, - 'magento-init-params' => '', 'safe-mode' => false, 'data-restore' => false, 'dry-run' => false, + 'dump' => null, + 'magento-init-params' => '', ] ], [ @@ -129,10 +130,11 @@ public function executeDataProvider() 'expectedOptions' => [ 'keep-generated' => true, 'convert-old-scripts' => false, - 'magento-init-params' => '', 'safe-mode' => false, 'data-restore' => false, 'dry-run' => false, + 'dump' => null, + 'magento-init-params' => '', ] ], [ @@ -142,10 +144,11 @@ public function executeDataProvider() 'expectedOptions' => [ 'keep-generated' => false, 'convert-old-scripts' => false, - 'magento-init-params' => '', 'safe-mode' => false, 'data-restore' => false, 'dry-run' => false, + 'dump' => null, + 'magento-init-params' => '', ] ], [ @@ -155,10 +158,11 @@ public function executeDataProvider() 'expectedOptions' => [ 'keep-generated' => false, 'convert-old-scripts' => false, - 'magento-init-params' => '', 'safe-mode' => false, 'data-restore' => false, 'dry-run' => false, + 'dump' => null, + 'magento-init-params' => '', ] ], ]; From f83f8572d0124d132e38bcbf9ac7308ac1b1509a Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Wed, 16 May 2018 13:49:31 +0300 Subject: [PATCH 05/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- .../Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php index f36675e26fa02..dd596cfd5aa4f 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php @@ -58,10 +58,10 @@ public function executeDataProvider() [ 'options' => [ '--magento-init-params' => '', - '--convert_old_scripts' => false + '--convert-old-scripts' => false ], 'expectedOptions' => [ - 'convert_old_scripts' => false, + 'convert-old-scripts' => false, 'magento-init-params' => '', ] ], From 44ed7b89976a2330985e829d9e2e4d146170b5cd Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Wed, 16 May 2018 16:00:49 +0300 Subject: [PATCH 06/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- .../Developer/Console/Command/GeneratePatchCommand.php | 5 +++-- .../Console/Command/TablesWhitelistGenerateCommand.php | 6 ++++-- setup/src/Magento/Setup/Console/Command/InstallCommand.php | 6 ++++-- .../Unit/Console/Command/DbSchemaUpgradeCommandTest.php | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php b/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php index 1cc76ed41d4fb..a417f688e1144 100644 --- a/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php +++ b/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Developer\Console\Command; @@ -89,7 +90,7 @@ protected function configure() * * @return string */ - private function getPatchTemplate() + private function getPatchTemplate() : string { return file_get_contents(__DIR__ . '/patch_template.php.dist'); } @@ -98,7 +99,7 @@ private function getPatchTemplate() * {@inheritdoc} * @throws \InvalidArgumentException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output) : int { $moduleName = $input->getArgument(self::MODULE_NAME); $patchName = $input->getArgument(self::INPUT_KEY_PATCH_NAME); diff --git a/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php b/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php index e24fea6a11e39..ba49baaf4f3ad 100644 --- a/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php +++ b/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Developer\Console\Command; use Magento\Framework\Component\ComponentRegistrar; @@ -122,7 +124,7 @@ private function persistModule($moduleName) /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output) : int { $moduleName = $input->getOption(self::MODULE_NAME_KEY); @@ -149,7 +151,7 @@ protected function execute(InputInterface $input, OutputInterface $output) * @param array $content * @return array */ - private function selectNamesFromContent(array $content) + private function selectNamesFromContent(array $content) : array { $names = []; $types = ['column', 'index', 'constraint']; diff --git a/setup/src/Magento/Setup/Console/Command/InstallCommand.php b/setup/src/Magento/Setup/Console/Command/InstallCommand.php index 80e2732d8357e..58a2cbdbc3d26 100644 --- a/setup/src/Magento/Setup/Console/Command/InstallCommand.php +++ b/setup/src/Magento/Setup/Console/Command/InstallCommand.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Setup\Console\Command; use Magento\Deploy\Console\Command\App\ConfigImportCommand; @@ -277,7 +279,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) * @param InputInterface $input * @return string[] Array of error messages */ - public function validate(InputInterface $input) + public function validate(InputInterface $input) : array { $errors = []; $value = $input->getOption(self::INPUT_KEY_SALES_ORDER_INCREMENT_PREFIX); @@ -297,7 +299,7 @@ public function validate(InputInterface $input) * @param OutputInterface $output * @return string[] Array of inputs */ - private function interactiveQuestions(InputInterface $input, OutputInterface $output) + private function interactiveQuestions(InputInterface $input, OutputInterface $output) : array { $helper = $this->getHelper('question'); $configOptionsToValidate = []; diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php index dd596cfd5aa4f..61c004c2e0b5f 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbSchemaUpgradeCommandTest.php @@ -3,10 +3,10 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Setup\Test\Unit\Console\Command; -use Magento\Framework\Module\ModuleList; use Magento\Setup\Console\Command\DbSchemaUpgradeCommand; use Symfony\Component\Console\Tester\CommandTester; From 14ae834b447ce622d0c59f4276ba39bb140b5c8f Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Wed, 16 May 2018 16:23:35 +0300 Subject: [PATCH 07/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- setup/src/Magento/Setup/Console/Command/InstallCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Console/Command/InstallCommand.php b/setup/src/Magento/Setup/Console/Command/InstallCommand.php index 58a2cbdbc3d26..1d3f6bb744a62 100644 --- a/setup/src/Magento/Setup/Console/Command/InstallCommand.php +++ b/setup/src/Magento/Setup/Console/Command/InstallCommand.php @@ -283,7 +283,7 @@ public function validate(InputInterface $input) : array { $errors = []; $value = $input->getOption(self::INPUT_KEY_SALES_ORDER_INCREMENT_PREFIX); - if (preg_match(self::SALES_ORDER_INCREMENT_PREFIX_RULE, $value) != 1) { + if (preg_match(self::SALES_ORDER_INCREMENT_PREFIX_RULE, (string) $value) != 1) { $errors[] = 'Validation failed, ' . self::INPUT_KEY_SALES_ORDER_INCREMENT_PREFIX . ' must be 20 characters or less'; } From 8248a6656af46066506c1b95dc6c7963c6d588b1 Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Wed, 16 May 2018 18:21:54 +0300 Subject: [PATCH 08/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- .../Declaration/Schema/Diff/DiffInterface.php | 3 -- .../Setup/Declaration/Schema/Request.php | 45 ----------------- .../Declaration/Schema/RequestFactory.php | 49 ------------------- .../Setup/Console/Command/InstallCommand.php | 7 --- .../Setup/Console/Command/UpgradeCommand.php | 9 +--- 5 files changed, 1 insertion(+), 112 deletions(-) delete mode 100644 lib/internal/Magento/Framework/Setup/Declaration/Schema/Request.php delete mode 100644 lib/internal/Magento/Framework/Setup/Declaration/Schema/RequestFactory.php diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/DiffInterface.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/DiffInterface.php index 4b6e3555256fb..c24b861aca2cd 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/DiffInterface.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/DiffInterface.php @@ -7,9 +7,6 @@ namespace Magento\Framework\Setup\Declaration\Schema\Diff; use Magento\Framework\Setup\Declaration\Schema\Dto\ElementInterface; -use Magento\Framework\Setup\Declaration\Schema\Dto\Schema; -use Magento\Framework\Setup\Declaration\Schema\ElementHistory; -use Magento\Framework\Setup\Declaration\Schema\Request; /** * DiffInterface is type of classes, that holds all information diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Request.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Request.php deleted file mode 100644 index 9271e6834945f..0000000000000 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Request.php +++ /dev/null @@ -1,45 +0,0 @@ -dumpEnable = (bool) $request[static::DUMP_ENABLE_OPTIONS]; - } - } - - /** - * Check whether dump is enabled. - * - * @return boolean - */ - public function isDumpEnabled() - { - return $this->dumpEnable; - } -} diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/RequestFactory.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/RequestFactory.php deleted file mode 100644 index 8f76815d4dc12..0000000000000 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/RequestFactory.php +++ /dev/null @@ -1,49 +0,0 @@ -zendDi = $zendDi; - } - - /** - * Create request object with requestOptions params. - * - * @param array $requestOptions - * @return Request - */ - public function create(array $requestOptions = []) - { - return $this->zendDi->newInstance( - self::$instanceName, - ['request' => $requestOptions] - ); - } -} diff --git a/setup/src/Magento/Setup/Console/Command/InstallCommand.php b/setup/src/Magento/Setup/Console/Command/InstallCommand.php index 1d3f6bb744a62..7b54d2e80c346 100644 --- a/setup/src/Magento/Setup/Console/Command/InstallCommand.php +++ b/setup/src/Magento/Setup/Console/Command/InstallCommand.php @@ -10,7 +10,6 @@ use Magento\Deploy\Console\Command\App\ConfigImportCommand; use Magento\Framework\Setup\Declaration\Schema\DryRunLogger; use Magento\Framework\Setup\Declaration\Schema\OperationsExecutor; -use Magento\Framework\Setup\Declaration\Schema\Request; use Magento\Setup\Model\ConfigModel; use Magento\Setup\Model\InstallerFactory; use Magento\Framework\Setup\ConsoleLogger; @@ -157,12 +156,6 @@ protected function configure() InputOption::VALUE_NONE, 'Use sample data' ), - new InputOption( - Request::DUMP_ENABLE_OPTIONS, - null, - InputOption::VALUE_REQUIRED, - 'Should removed columns be dumped or recovered columns data reverted.' - ), new InputOption( self::INPUT_KEY_ENABLE_MODULES, null, diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index ea67d69f537ce..15d55c31118b0 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -12,7 +12,6 @@ use Magento\Framework\Setup\ConsoleLogger; use Magento\Framework\Setup\Declaration\Schema\DryRunLogger; use Magento\Framework\Setup\Declaration\Schema\OperationsExecutor; -use Magento\Framework\Setup\Declaration\Schema\Request; use Magento\Setup\Model\InstallerFactory; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; @@ -103,13 +102,7 @@ protected function configure() InputOption::VALUE_OPTIONAL, 'Magento Installation will be run in dry-run mode', false - ), - new InputOption( - Request::DUMP_ENABLE_OPTIONS, - null, - InputOption::VALUE_REQUIRED, - 'Should removed columns be dumped or recovered columns data reverted.' - ), + ) ]; $this->setName('setup:upgrade') ->setDescription('Upgrades the Magento application, DB data, and schema') From 169926a4fb5c4f2087393f327ea3b29b52fe50ff Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Wed, 16 May 2018 19:17:32 +0300 Subject: [PATCH 09/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- .../src/Magento/Setup/Model/DeclarationInstaller.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/setup/src/Magento/Setup/Model/DeclarationInstaller.php b/setup/src/Magento/Setup/Model/DeclarationInstaller.php index 52c360251c25a..4313b031a1626 100644 --- a/setup/src/Magento/Setup/Model/DeclarationInstaller.php +++ b/setup/src/Magento/Setup/Model/DeclarationInstaller.php @@ -7,7 +7,6 @@ use Magento\Framework\Setup\Declaration\Schema\Diff\SchemaDiff; use Magento\Framework\Setup\Declaration\Schema\OperationsExecutor; -use Magento\Framework\Setup\Declaration\Schema\RequestFactory; use Magento\Framework\Setup\Declaration\Schema\SchemaConfigInterface; /** @@ -25,11 +24,6 @@ class DeclarationInstaller */ private $schemaDiff; - /** - * @var RequestFactory - */ - private $requestFactory; - /** * @var SchemaConfigInterface */ @@ -41,16 +35,13 @@ class DeclarationInstaller * @param SchemaConfigInterface $schemaConfig * @param SchemaDiff $schemaDiff * @param OperationsExecutor $operationsExecutor - * @param RequestFactory $requestFactory */ public function __construct( SchemaConfigInterface $schemaConfig, SchemaDiff $schemaDiff, - OperationsExecutor $operationsExecutor, - RequestFactory $requestFactory + OperationsExecutor $operationsExecutor ) { $this->operationsExecutor = $operationsExecutor; - $this->requestFactory = $requestFactory; $this->schemaConfig = $schemaConfig; $this->schemaDiff = $schemaDiff; } From 5a9ff460448d8fe175e8e235b283241cc993cc26 Mon Sep 17 00:00:00 2001 From: Sergii Kovalenko Date: Thu, 17 May 2018 11:25:03 +0300 Subject: [PATCH 10/95] MAGETWO-91034: Renaming of new setup commands and setup:install/setup:upgrade attributes --- .../Setup/Test/Unit/Console/Command/UpgradeCommandTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php index 4b8b22315ba64..3d46736e449c4 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php @@ -115,7 +115,6 @@ public function executeDataProvider() 'safe-mode' => false, 'data-restore' => false, 'dry-run' => false, - 'dump' => null, 'magento-init-params' => '', ] ], @@ -133,7 +132,6 @@ public function executeDataProvider() 'safe-mode' => false, 'data-restore' => false, 'dry-run' => false, - 'dump' => null, 'magento-init-params' => '', ] ], @@ -147,7 +145,6 @@ public function executeDataProvider() 'safe-mode' => false, 'data-restore' => false, 'dry-run' => false, - 'dump' => null, 'magento-init-params' => '', ] ], @@ -161,7 +158,6 @@ public function executeDataProvider() 'safe-mode' => false, 'data-restore' => false, 'dry-run' => false, - 'dump' => null, 'magento-init-params' => '', ] ], From ab2c8ef50683f23cd715551a9a5afae19e6d3a1c Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun Date: Thu, 17 May 2018 15:08:15 +0300 Subject: [PATCH 11/95] MAGETWO-88603: Invalid Video Uploader Link --- .../view/adminhtml/web/js/new-video-dialog.js | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js index 1ab10c95a51bc..f575f28a5c737 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js @@ -86,6 +86,9 @@ define([ * @private */ _doUpdate: function () { + var uploaderLinkUrl, + uploaderLink; + this.reset(); this.element.find(this.options.container).append('
' + - this.options.metaData.data.uploader + - '' - ); + uploaderLinkUrl = 'https://youtube.com/channel/' + this.options.metaData.data.uploaderUrl; } else if (this.options.videoProvider === 'vimeo') { - this.element.find(this.options.metaData.DOM.uploader).html( - '' + this.options.metaData.data.uploader + - ''); + uploaderLinkUrl = this.options.metaData.data.uploaderUrl; } + uploaderLink = document.createElement('a'); + uploaderLink.setAttribute('href', uploaderLinkUrl); + uploaderLink.setAttribute('target', '_blank'); + uploaderLink.innerText = this.options.metaData.data.uploader; + this.element.find(this.options.metaData.DOM.uploader)[0].appendChild(uploaderLink); this.element.find('.' + this.options.videoClass).productVideoLoader(); }, From f3e15f2e558ae64439e6ebf5cdadee69c9bbed16 Mon Sep 17 00:00:00 2001 From: Dmytro Voskoboinikov Date: Mon, 11 Jun 2018 18:15:27 +0300 Subject: [PATCH 12/95] MAGETWO-72021: Wysiwyg editor incorrectly processes attributes of HTML5 tags --- .../adminhtml/wysiwyg/tiny_mce/html5-schema.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js index 48960ed3403c0..98ce6a005db04 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js @@ -186,11 +186,19 @@ define([ }); _.each(compiled, function (node, nodeName) { - var attributes = node.attributes.join('|'), - children = node.children.join('|'); + var filteredAttributes = []; - validElements.push(nodeName + '[' + attributes + ']'); - validChildren.push(nodeName + '[' + children + ']'); + _.each(node.attributes, function (attribute) { //eslint-disable-line max-nested-callbacks + // Disallowing usage of 'on*' attributes. + if (!/^on/.test(attribute)) { + filteredAttributes.push(attribute); + } + }); + + node.attributes = filteredAttributes; + + validElements.push(nodeName + '[' + node.attributes.join('|') + ']'); + validChildren.push(nodeName + '[' + node.children.join('|') + ']'); }); return { From 128865918d5a3e0962094a54d1db7f9fce9cea1b Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Thu, 19 Jul 2018 16:06:59 +0200 Subject: [PATCH 13/95] Small image URL added to the product data --- .../Model/Resolver/Product/SmallImageUrl.php | 122 ++++++++++++++++++ .../CatalogGraphQl/etc/schema.graphqls | 1 + 2 files changed, 123 insertions(+) create mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php new file mode 100644 index 0000000000000..4e749716a965e --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php @@ -0,0 +1,122 @@ +valueFactory = $valueFactory; + $this->catalogImageHelper = $catalogImageHelper; + $this->areaList = $areaList; + $this->galleryResourceFactory = $galleryResourceFactory; + } + + /** + * {@inheritdoc} + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ): Value { + if (!isset($value['model'])) { + $result = function () { + return null; + }; + return $this->valueFactory->create($result); + } + /** @var Product $product */ + $product = $value['model']; + + /* If small_image is not loaded for product, need to load it separately */ + if (!$product->getSmallImage()) { + $galleryResource = $this->galleryResourceFactory->create(); + $productImages = $galleryResource->getProductImages($product, [Store::DEFAULT_STORE_ID]); + $productSmallImage = $this->getSmallImageFromGallery($productImages); + $product->setSmallImage($productSmallImage); + } + + /* Design area is necessary to return the correct storefront image URL (or a placeholder) */ + $area = $this->areaList->getArea(Area::AREA_FRONTEND); + $area->load(Area::PART_DESIGN); + + $smallImageURL = $this->catalogImageHelper->init($product, 'product_small_image')->getUrl(); + $product->getMediaAttributes(); + + $result = function () use ($smallImageURL) { + return $smallImageURL; + }; + + return $this->valueFactory->create($result); + } + + /** + * Retrieves small image from the product gallery image + * + * @param $productImages + * @return string|null + */ + private function getSmallImageFromGallery(array $productImages) + { + foreach ($productImages as $productImage) { + if ($productImage['attribute_code'] == 'small_image') { + return $productImage['filepath']; + } + } + + return null; + } +} diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 762861de94e67..5018795b3197d 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -259,6 +259,7 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ meta_description: String @doc(description: "A brief overview of the product for search results listings, maximum 255 characters") image: String @doc(description: "The relative path to the main image on the product page") small_image: String @doc(description: "The relative path to the small image, which is used on catalog pages") + small_image_url: String @doc(description: "The small image URL, which is used on catalog pages") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\SmallImageUrl") thumbnail: String @doc(description: "The relative path to the product's thumbnail image") new_from_date: String @doc(description: "The beginning date for new product listings, and determines if the product is featured as a new product") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") new_to_date: String @doc(description: "The end date for new product listings") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") From ca13aa8abd3c71a88e8b40b83078298df4b7fcb0 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Thu, 26 Jul 2018 13:54:21 +0200 Subject: [PATCH 14/95] API-functional tests added --- .../GraphQl/Catalog/MediaGalleryTest.php | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php new file mode 100644 index 0000000000000..cb5074bf99cf4 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -0,0 +1,68 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testProductSmallImageUrlWithExistingImage() + { + $productSku = 'simple'; + $query = <<graphQlQuery($query); + + self::assertArrayHasKey('small_image_url', $response['products']['items'][0]); + self::assertContains('magento_image.jpg', $response['products']['items'][0]['small_image_url']); + } + + /** + * small_image_url should contain a placeholder when there's no small image assigned + * to the product + * + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + */ + public function testProductSmallImageUrlWithNoImage() + { + $productSku = 'simple'; + $query = <<graphQlQuery($query); + + self::assertArrayHasKey('small_image_url', $response['products']['items'][0]); + self::assertContains('placeholder/small_image.jpg', $response['products']['items'][0]['small_image_url']); + } +} From f41eb3e1b2581cc7610649c3ac52524a448d05bd Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Tue, 31 Jul 2018 14:38:25 +0200 Subject: [PATCH 15/95] Use current store id instead of admin store id --- .../Model/Resolver/Product/SmallImageUrl.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php index 4e749716a965e..fa7037c88937c 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php @@ -17,7 +17,7 @@ use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; /** * Returns product's small image. If the small image is not set, returns a placeholder @@ -44,22 +44,30 @@ class SmallImageUrl implements ResolverInterface */ private $valueFactory; + /** + * @var StoreManagerInterface + */ + private $storeManager; + /** * @param ValueFactory $valueFactory * @param CatalogImageHelper $catalogImageHelper * @param AreaList $areaList * @param GalleryResourceFactory $galleryResourceFactory + * @param StoreManagerInterface $storeManager */ public function __construct( ValueFactory $valueFactory, CatalogImageHelper $catalogImageHelper, AreaList $areaList, - GalleryResourceFactory $galleryResourceFactory + GalleryResourceFactory $galleryResourceFactory, + StoreManagerInterface $storeManager ) { $this->valueFactory = $valueFactory; $this->catalogImageHelper = $catalogImageHelper; $this->areaList = $areaList; $this->galleryResourceFactory = $galleryResourceFactory; + $this->storeManager = $storeManager; } /** @@ -84,7 +92,8 @@ public function resolve( /* If small_image is not loaded for product, need to load it separately */ if (!$product->getSmallImage()) { $galleryResource = $this->galleryResourceFactory->create(); - $productImages = $galleryResource->getProductImages($product, [Store::DEFAULT_STORE_ID]); + $currentStoreId =$this->storeManager->getStore()->getId(); + $productImages = $galleryResource->getProductImages($product, [$currentStoreId]); $productSmallImage = $this->getSmallImageFromGallery($productImages); $product->setSmallImage($productSmallImage); } From 79ef4a45c2d18eeae631205a1f1b4bd17d195e99 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun Date: Wed, 15 Aug 2018 15:42:00 +0300 Subject: [PATCH 16/95] MAGETWO-88597: Varnish Config Access List --- .../System/Config/Backend/AccessList.php | 37 ++++++++ .../System/Config/Backend/AccessListTest.php | 90 +++++++++++++++++++ .../PageCache/etc/adminhtml/system.xml | 2 +- 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php create mode 100644 app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php diff --git a/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php b/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php new file mode 100644 index 0000000000000..e16584b0b17f8 --- /dev/null +++ b/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php @@ -0,0 +1,37 @@ +getValue(); + if (!is_string($value) || !preg_match('/^[\w\s\.\-\,\:]+$/', $value)) { + throw new LocalizedException( + new Phrase( + 'Access List value "%1" is not valid. ' + .'Please use only IP addresses and host names.', + [$value] + ) + ); + } + } +} diff --git a/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php b/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php new file mode 100644 index 0000000000000..1c4f279917c68 --- /dev/null +++ b/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php @@ -0,0 +1,90 @@ +getMockForAbstractClass( + ScopeConfigInterface::class + ); + $configMock->expects($this->any()) + ->method('getValue') + ->with('system/full_page_cache/default') + ->willReturn(['access_list' => 'localhost']); + $this->accessList = $objectManager->getObject( + AccessList::class, + [ + 'config' => $configMock, + 'data' => ['field' => 'access_list'] + ] + ); + } + + /** + * @return array + */ + public function getValidValues(): array + { + return [ + ['localhost', 'localhost'], + [null, 'localhost'], + ['127.0.0.1', '127.0.0.1'], + ['127.0.0.1, localhost, ::2', '127.0.0.1, localhost, ::2'], + ]; + } + + /** + * @param mixed $value + * @param mixed $expectedValue + * @dataProvider getValidValues + */ + public function testBeforeSave($value, $expectedValue) + { + $this->accessList->setValue($value); + $this->accessList->beforeSave(); + $this->assertEquals($expectedValue, $this->accessList->getValue()); + } + + /** + * @return array + */ + public function getInvalidValues(): array + { + return [ + ['\\bull val\\'], + ['{*I am not an IP*}'], + ['{*I am not an IP*}, 127.0.0.1'], + ]; + } + + /** + * @param mixed $value + * @expectedException \Magento\Framework\Exception\LocalizedException + * @dataProvider getInvalidValues + */ + public function testBeforeSaveInvalid($value) + { + $this->accessList->setValue($value); + $this->accessList->beforeSave(); + } +} diff --git a/app/code/Magento/PageCache/etc/adminhtml/system.xml b/app/code/Magento/PageCache/etc/adminhtml/system.xml index 1d6c0d890737b..7282a2608496f 100644 --- a/app/code/Magento/PageCache/etc/adminhtml/system.xml +++ b/app/code/Magento/PageCache/etc/adminhtml/system.xml @@ -20,7 +20,7 @@ IPs access list separated with ',' that can purge Varnish configuration for config file generation. If field is empty default value localhost will be saved. - Magento\PageCache\Model\System\Config\Backend\Varnish + Magento\PageCache\Model\System\Config\Backend\AccessList 1 From 3d7e76d6e4a1cb17e3a718221853a71a7473965f Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun Date: Wed, 15 Aug 2018 17:45:58 +0300 Subject: [PATCH 17/95] MAGETWO-88597: Varnish Config Access List --- .../Test/Unit/Model/System/Config/Backend/AccessListTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php b/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php index 1c4f279917c68..e84b412beb8a5 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php @@ -4,6 +4,8 @@ * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\PageCache\Test\Unit\Model\System\Config\Backend; use Magento\PageCache\Model\System\Config\Backend\AccessList; From d4b5e99daa10a83de61105ea87216b42d17f9d8a Mon Sep 17 00:00:00 2001 From: Tiago Sampaio Date: Sat, 18 Aug 2018 22:46:40 -0300 Subject: [PATCH 18/95] Replacing deprecated methods from Magento_Backend module. --- .../Backend/App/Action/Plugin/Authentication.php | 4 ++-- .../Backend/Controller/Adminhtml/Auth/Logout.php | 2 +- .../Backend/Controller/Adminhtml/Cache/CleanImages.php | 6 +++--- .../Backend/Controller/Adminhtml/Cache/CleanMedia.php | 6 +++--- .../Controller/Adminhtml/Cache/CleanStaticFiles.php | 2 +- .../Backend/Controller/Adminhtml/Cache/FlushAll.php | 2 +- .../Backend/Controller/Adminhtml/Cache/FlushSystem.php | 2 +- .../Backend/Controller/Adminhtml/Cache/MassDisable.php | 6 +++--- .../Backend/Controller/Adminhtml/Cache/MassEnable.php | 6 +++--- .../Backend/Controller/Adminhtml/Cache/MassRefresh.php | 6 +++--- .../Adminhtml/Dashboard/RefreshStatistics.php | 4 ++-- .../Controller/Adminhtml/System/Account/Save.php | 10 +++++----- .../Controller/Adminhtml/System/Design/Delete.php | 6 +++--- .../Controller/Adminhtml/System/Design/Save.php | 4 ++-- .../Backend/Controller/Adminhtml/System/Store.php | 8 ++++---- .../Controller/Adminhtml/System/Store/DeleteGroup.php | 4 ++-- .../Adminhtml/System/Store/DeleteGroupPost.php | 10 +++++----- .../Controller/Adminhtml/System/Store/DeleteStore.php | 4 ++-- .../Adminhtml/System/Store/DeleteStorePost.php | 10 +++++----- .../Adminhtml/System/Store/DeleteWebsite.php | 4 ++-- .../Adminhtml/System/Store/DeleteWebsitePost.php | 10 +++++----- .../Controller/Adminhtml/System/Store/EditStore.php | 4 ++-- .../Backend/Controller/Adminhtml/System/Store/Save.php | 10 +++++----- .../Unit/Controller/Adminhtml/Cache/CleanMediaTest.php | 4 ++-- .../Adminhtml/Cache/CleanStaticFilesTest.php | 2 +- .../Controller/Adminhtml/Cache/MassDisableTest.php | 6 +++--- .../Unit/Controller/Adminhtml/Cache/MassEnableTest.php | 6 +++--- .../Adminhtml/Dashboard/RefreshStatisticsTest.php | 2 +- .../Controller/Adminhtml/System/Account/SaveTest.php | 4 ++-- 29 files changed, 77 insertions(+), 77 deletions(-) diff --git a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php index 68506a521c1cf..4b25e9921e404 100644 --- a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php +++ b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php @@ -160,7 +160,7 @@ protected function _processNotLoggedInUser(\Magento\Framework\App\RequestInterfa } else { $this->_actionFlag->set('', \Magento\Framework\App\ActionInterface::FLAG_NO_DISPATCH, true); $this->_response->setRedirect($this->_url->getCurrentUrl()); - $this->messageManager->addError(__('Invalid Form Key. Please refresh the page.')); + $this->messageManager->addErrorMessage(__('Invalid Form Key. Please refresh the page.')); $isRedirectNeeded = true; } } @@ -205,7 +205,7 @@ protected function _performLogin(\Magento\Framework\App\RequestInterface $reques $this->_auth->login($username, $password); } catch (AuthenticationException $e) { if (!$request->getParam('messageSent')) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); $request->setParam('messageSent', true); $outputValue = false; } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php index 41e32c929287a..e55c449a0e5bb 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php @@ -16,7 +16,7 @@ class Logout extends \Magento\Backend\Controller\Adminhtml\Auth public function execute() { $this->_auth->logout(); - $this->messageManager->addSuccess(__('You have logged out.')); + $this->messageManager->addSuccessMessage(__('You have logged out.')); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanImages.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanImages.php index 7a926b1c09c3e..888ce11313b8a 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanImages.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanImages.php @@ -28,11 +28,11 @@ public function execute() try { $this->_objectManager->create(\Magento\Catalog\Model\Product\Image::class)->clearCache(); $this->_eventManager->dispatch('clean_catalog_images_cache_after'); - $this->messageManager->addSuccess(__('The image cache was cleaned.')); + $this->messageManager->addSuccessMessage(__('The image cache was cleaned.')); } catch (LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('An error occurred while clearing the image cache.')); + $this->messageManager->addExceptionMessage($e, __('An error occurred while clearing the image cache.')); } /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanMedia.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanMedia.php index 72f23ab65cf8a..30aeb038ff9c2 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanMedia.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanMedia.php @@ -28,11 +28,11 @@ public function execute() try { $this->_objectManager->get(\Magento\Framework\View\Asset\MergeService::class)->cleanMergedJsCss(); $this->_eventManager->dispatch('clean_media_cache_after'); - $this->messageManager->addSuccess(__('The JavaScript/CSS cache has been cleaned.')); + $this->messageManager->addSuccessMessage(__('The JavaScript/CSS cache has been cleaned.')); } catch (LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('An error occurred while clearing the JavaScript/CSS cache.')); + $this->messageManager->addExceptionMessage($e, __('An error occurred while clearing the JavaScript/CSS cache.')); } /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles.php index 27ae2fc31e150..489eb5799a5e7 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles.php @@ -26,7 +26,7 @@ public function execute() { $this->_objectManager->get(\Magento\Framework\App\State\CleanupFiles::class)->clearMaterializedViewFiles(); $this->_eventManager->dispatch('clean_static_files_cache_after'); - $this->messageManager->addSuccess(__('The static files cache has been cleaned.')); + $this->messageManager->addSuccessMessage(__('The static files cache has been cleaned.')); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushAll.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushAll.php index ca89ea58fa6f3..a2f18b4baf53d 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushAll.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushAll.php @@ -27,7 +27,7 @@ public function execute() foreach ($this->_cacheFrontendPool as $cacheFrontend) { $cacheFrontend->getBackend()->clean(); } - $this->messageManager->addSuccess(__("You flushed the cache storage.")); + $this->messageManager->addSuccessMessage(__("You flushed the cache storage.")); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); return $resultRedirect->setPath('adminhtml/*'); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem.php index f0fed159e0f22..90ed3432fa87b 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem.php @@ -27,7 +27,7 @@ public function execute() $cacheFrontend->clean(); } $this->_eventManager->dispatch('adminhtml_cache_flush_system'); - $this->messageManager->addSuccess(__("The Magento cache storage has been flushed.")); + $this->messageManager->addSuccessMessage(__("The Magento cache storage has been flushed.")); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); return $resultRedirect->setPath('adminhtml/*'); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php index 2bfa937b06b77..03b88ca1d3f47 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php @@ -67,12 +67,12 @@ private function disableCache() } if ($updatedTypes > 0) { $this->_cacheState->persist(); - $this->messageManager->addSuccess(__("%1 cache type(s) disabled.", $updatedTypes)); + $this->messageManager->addSuccessMessage(__("%1 cache type(s) disabled.", $updatedTypes)); } } catch (LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('An error occurred while disabling cache.')); + $this->messageManager->addExceptionMessage($e, __('An error occurred while disabling cache.')); } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassEnable.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassEnable.php index 113e0f2d8961b..1b98a00d4bf35 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassEnable.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassEnable.php @@ -66,12 +66,12 @@ private function enableCache() } if ($updatedTypes > 0) { $this->_cacheState->persist(); - $this->messageManager->addSuccess(__("%1 cache type(s) enabled.", $updatedTypes)); + $this->messageManager->addSuccessMessage(__("%1 cache type(s) enabled.", $updatedTypes)); } } catch (LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('An error occurred while enabling cache.')); + $this->messageManager->addExceptionMessage($e, __('An error occurred while enabling cache.')); } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassRefresh.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassRefresh.php index 3843b030afb3d..bde211debcf72 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassRefresh.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache/MassRefresh.php @@ -37,12 +37,12 @@ public function execute() $updatedTypes++; } if ($updatedTypes > 0) { - $this->messageManager->addSuccess(__("%1 cache type(s) refreshed.", $updatedTypes)); + $this->messageManager->addSuccessMessage(__("%1 cache type(s) refreshed.", $updatedTypes)); } } catch (LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('An error occurred while refreshing cache.')); + $this->messageManager->addExceptionMessage($e, __('An error occurred while refreshing cache.')); } /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php index f831fa67f4bb0..c10d1a77997b7 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php @@ -34,9 +34,9 @@ public function execute() foreach ($collectionsNames as $collectionName) { $this->_objectManager->create($collectionName)->aggregate(); } - $this->messageManager->addSuccess(__('We updated lifetime statistic.')); + $this->messageManager->addSuccessMessage(__('We updated lifetime statistic.')); } catch (\Exception $e) { - $this->messageManager->addError(__('We can\'t refresh lifetime statistics.')); + $this->messageManager->addErrorMessage(__('We can\'t refresh lifetime statistics.')); $this->logger->critical($e); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php index 1b10c151a9d21..d95b0541c2c76 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php @@ -76,12 +76,12 @@ public function execute() $errors = $user->validate(); if ($errors !== true && !empty($errors)) { foreach ($errors as $error) { - $this->messageManager->addError($error); + $this->messageManager->addErrorMessage($error); } } else { $user->save(); $user->sendNotificationEmailsIfRequired(); - $this->messageManager->addSuccess(__('You saved the account.')); + $this->messageManager->addSuccessMessage(__('You saved the account.')); } } catch (UserLockedException $e) { $this->_auth->logout(); @@ -91,12 +91,12 @@ public function execute() } catch (ValidatorException $e) { $this->messageManager->addMessages($e->getMessages()); if ($e->getMessage()) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } } catch (LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addError(__('An error occurred while saving account.')); + $this->messageManager->addErrorMessage(__('An error occurred while saving account.')); } /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Design/Delete.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Design/Delete.php index 76402169f269e..21f28188cf874 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Design/Delete.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Design/Delete.php @@ -19,11 +19,11 @@ public function execute() try { $design->delete(); - $this->messageManager->addSuccess(__('You deleted the design change.')); + $this->messageManager->addSuccessMessage(__('You deleted the design change.')); } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __("You can't delete the design change.")); + $this->messageManager->addExceptionMessage($e, __("You can't delete the design change.")); } } /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php index 1f478604ced7d..0228b48f7f11e 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php @@ -50,9 +50,9 @@ public function execute() try { $design->save(); $this->_eventManager->dispatch('theme_save_after'); - $this->messageManager->addSuccess(__('You saved the design change.')); + $this->messageManager->addSuccessMessage(__('You saved the design change.')); } catch (\Exception $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); $this->_objectManager->get(\Magento\Backend\Model\Session::class)->setDesignData($data); return $resultRedirect->setPath('adminhtml/*/', ['id' => $design->getId()]); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php index 4fbae6abb423a..0beeb5168b6d1 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php @@ -103,12 +103,12 @@ protected function _backupDatabase() ->setType('db') ->setPath($filesystem->getDirectoryRead(DirectoryList::VAR_DIR)->getAbsolutePath('backups')); $backupDb->createBackup($backup); - $this->messageManager->addSuccess(__('The database was backed up.')); + $this->messageManager->addSuccessMessage(__('The database was backed up.')); } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); return false; } catch (\Exception $e) { - $this->messageManager->addException( + $this->messageManager->addExceptionMessage( $e, __('We can\'t create a backup right now. Please try again later.') ); @@ -125,7 +125,7 @@ protected function _backupDatabase() */ protected function _addDeletionNotice($typeTitle) { - $this->messageManager->addNotice( + $this->messageManager->addNoticeMessage( __( 'Deleting a %1 will not delete the information associated with the %1 (e.g. categories, products, etc.)' . ', but the %1 will not be able to be restored. It is suggested that you create a database backup ' diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroup.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroup.php index 925ae4c69ee8e..4e323be709ae1 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroup.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroup.php @@ -15,13 +15,13 @@ public function execute() { $itemId = $this->getRequest()->getParam('item_id', null); if (!($model = $this->_objectManager->create(\Magento\Store\Model\Group::class)->load($itemId))) { - $this->messageManager->addError(__('Something went wrong. Please try again.')); + $this->messageManager->addErrorMessage(__('Something went wrong. Please try again.')); /** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */ $redirectResult = $this->resultRedirectFactory->create(); return $redirectResult->setPath('adminhtml/*/'); } if (!$model->isCanDelete()) { - $this->messageManager->addError(__('This store cannot be deleted.')); + $this->messageManager->addErrorMessage(__('This store cannot be deleted.')); /** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */ $redirectResult = $this->resultRedirectFactory->create(); return $redirectResult->setPath('adminhtml/*/editGroup', ['group_id' => $itemId]); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php index b6fbd88c7669c..23364aac1f0ab 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php @@ -21,11 +21,11 @@ public function execute() $redirectResult = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); if (!($model = $this->_objectManager->create(\Magento\Store\Model\Group::class)->load($itemId))) { - $this->messageManager->addError(__('Something went wrong. Please try again.')); + $this->messageManager->addErrorMessage(__('Something went wrong. Please try again.')); return $redirectResult->setPath('adminhtml/*/'); } if (!$model->isCanDelete()) { - $this->messageManager->addError(__('This store cannot be deleted.')); + $this->messageManager->addErrorMessage(__('This store cannot be deleted.')); return $redirectResult->setPath('adminhtml/*/editGroup', ['group_id' => $model->getId()]); } @@ -35,12 +35,12 @@ public function execute() try { $model->delete(); - $this->messageManager->addSuccess(__('You deleted the store.')); + $this->messageManager->addSuccessMessage(__('You deleted the store.')); return $redirectResult->setPath('adminhtml/*/'); } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('Unable to delete the store. Please try again later.')); + $this->messageManager->addExceptionMessage($e, __('Unable to delete the store. Please try again later.')); } return $redirectResult->setPath('adminhtml/*/editGroup', ['group_id' => $itemId]); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStore.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStore.php index b31de6cacc5ff..c340b1ec53aa5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStore.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStore.php @@ -15,13 +15,13 @@ public function execute() { $itemId = $this->getRequest()->getParam('item_id', null); if (!($model = $this->_objectManager->create(\Magento\Store\Model\Store::class)->load($itemId))) { - $this->messageManager->addError(__('Something went wrong. Please try again.')); + $this->messageManager->addErrorMessage(__('Something went wrong. Please try again.')); /** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */ $redirectResult = $this->resultRedirectFactory->create(); return $redirectResult->setPath('adminhtml/*/'); } if (!$model->isCanDelete()) { - $this->messageManager->addError(__('This store view cannot be deleted.')); + $this->messageManager->addErrorMessage(__('This store view cannot be deleted.')); /** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */ $redirectResult = $this->resultRedirectFactory->create(); return $redirectResult->setPath('adminhtml/*/editStore', ['store_id' => $itemId]); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php index 13b104c5ec4c0..518e5e1d549a3 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php @@ -22,11 +22,11 @@ public function execute() /** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */ $redirectResult = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); if (!($model = $this->_objectManager->create(\Magento\Store\Model\Store::class)->load($itemId))) { - $this->messageManager->addError(__('Something went wrong. Please try again.')); + $this->messageManager->addErrorMessage(__('Something went wrong. Please try again.')); return $redirectResult->setPath('adminhtml/*/'); } if (!$model->isCanDelete()) { - $this->messageManager->addError(__('This store view cannot be deleted.')); + $this->messageManager->addErrorMessage(__('This store view cannot be deleted.')); return $redirectResult->setPath('adminhtml/*/editStore', ['store_id' => $model->getId()]); } @@ -37,12 +37,12 @@ public function execute() try { $model->delete(); - $this->messageManager->addSuccess(__('You deleted the store view.')); + $this->messageManager->addSuccessMessage(__('You deleted the store view.')); return $redirectResult->setPath('adminhtml/*/'); } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('Unable to delete the store view. Please try again later.')); + $this->messageManager->addExceptionMessage($e, __('Unable to delete the store view. Please try again later.')); } return $redirectResult->setPath('adminhtml/*/editStore', ['store_id' => $itemId]); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsite.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsite.php index 1f2ec4b2ba4b1..d86f57daa396c 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsite.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsite.php @@ -15,13 +15,13 @@ public function execute() { $itemId = $this->getRequest()->getParam('item_id', null); if (!($model = $this->_objectManager->create(\Magento\Store\Model\Website::class)->load($itemId))) { - $this->messageManager->addError(__('Something went wrong. Please try again.')); + $this->messageManager->addErrorMessage(__('Something went wrong. Please try again.')); /** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */ $redirectResult = $this->resultRedirectFactory->create(); return $redirectResult->setPath('adminhtml/*/'); } if (!$model->isCanDelete()) { - $this->messageManager->addError(__('This website cannot be deleted.')); + $this->messageManager->addErrorMessage(__('This website cannot be deleted.')); /** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */ $redirectResult = $this->resultRedirectFactory->create(); return $redirectResult->setPath('adminhtml/*/editWebsite', ['website_id' => $itemId]); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php index c2d24b8c41a8c..1fca5a896e050 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php @@ -23,11 +23,11 @@ public function execute() $redirectResult = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); if (!$model) { - $this->messageManager->addError(__('Something went wrong. Please try again.')); + $this->messageManager->addErrorMessage(__('Something went wrong. Please try again.')); return $redirectResult->setPath('adminhtml/*/'); } if (!$model->isCanDelete()) { - $this->messageManager->addError(__('This website cannot be deleted.')); + $this->messageManager->addErrorMessage(__('This website cannot be deleted.')); return $redirectResult->setPath('adminhtml/*/editWebsite', ['website_id' => $model->getId()]); } @@ -37,12 +37,12 @@ public function execute() try { $model->delete(); - $this->messageManager->addSuccess(__('You deleted the website.')); + $this->messageManager->addSuccessMessage(__('You deleted the website.')); return $redirectResult->setPath('adminhtml/*/'); } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('Unable to delete the website. Please try again later.')); + $this->messageManager->addExceptionMessage($e, __('Unable to delete the website. Please try again later.')); } return $redirectResult->setPath('*/*/editWebsite', ['website_id' => $itemId]); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/EditStore.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/EditStore.php index cbc068a480865..a8651984cfa63 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/EditStore.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/EditStore.php @@ -57,7 +57,7 @@ public function execute() if ($model->getId() || $this->_coreRegistry->registry('store_action') == 'add') { $this->_coreRegistry->register('store_data', $model); if ($this->_coreRegistry->registry('store_action') == 'edit' && $codeBase && !$model->isReadOnly()) { - $this->messageManager->addNotice($codeBase); + $this->messageManager->addNoticeMessage($codeBase); } $resultPage = $this->createPage(); if ($this->_coreRegistry->registry('store_action') == 'add') { @@ -71,7 +71,7 @@ public function execute() )); return $resultPage; } else { - $this->messageManager->addError($notExists); + $this->messageManager->addErrorMessage($notExists); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); return $resultRedirect->setPath('adminhtml/*/'); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php index 8ca783f887ec4..910511c2b275e 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php @@ -32,7 +32,7 @@ private function processWebsiteSave($postData) } $websiteModel->save(); - $this->messageManager->addSuccess(__('You saved the website.')); + $this->messageManager->addSuccessMessage(__('You saved the website.')); return $postData; } @@ -68,7 +68,7 @@ private function processStoreSave($postData) ); } $storeModel->save(); - $this->messageManager->addSuccess(__('You saved the store view.')); + $this->messageManager->addSuccessMessage(__('You saved the store view.')); return $postData; } @@ -98,7 +98,7 @@ private function processGroupSave($postData) ); } $groupModel->save(); - $this->messageManager->addSuccess(__('You saved the store.')); + $this->messageManager->addSuccessMessage(__('You saved the store.')); return $postData; } @@ -134,10 +134,10 @@ public function execute() $redirectResult->setPath('adminhtml/*/'); return $redirectResult; } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); $this->_getSession()->setPostData($postData); } catch (\Exception $e) { - $this->messageManager->addException( + $this->messageManager->addExceptionMessage( $e, __('Something went wrong while saving. Please review the error log.') ); diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanMediaTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanMediaTest.php index b1911da024227..ac0f4a2f467c8 100644 --- a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanMediaTest.php +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanMediaTest.php @@ -38,7 +38,7 @@ public function testExecute() $messageManagerParams = $helper->getConstructArguments(\Magento\Framework\Message\Manager::class); $messageManagerParams['exceptionMessageFactory'] = $exceptionMessageFactory; $messageManager = $this->getMockBuilder(\Magento\Framework\Message\Manager::class) - ->setMethods(['addSuccess']) + ->setMethods(['addSuccessMessage']) ->setConstructorArgs($messageManagerParams) ->getMock(); @@ -86,7 +86,7 @@ public function testExecute() $mergeService->expects($this->once())->method('cleanMergedJsCss'); $messageManager->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with('The JavaScript/CSS cache has been cleaned.'); $valueMap = [ diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanStaticFilesTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanStaticFilesTest.php index 40d9ca1aa8996..fc457cd9681e6 100644 --- a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanStaticFilesTest.php +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanStaticFilesTest.php @@ -76,7 +76,7 @@ public function testExecute() ->with('clean_static_files_cache_after'); $this->messageManagerMock->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with('The static files cache has been cleaned.'); $resultRedirect = $this->getMockBuilder(\Magento\Backend\Model\View\Result\Redirect::class) diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/MassDisableTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/MassDisableTest.php index 197b46acc61bc..a8b248c611e07 100644 --- a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/MassDisableTest.php +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/MassDisableTest.php @@ -156,7 +156,7 @@ public function testExecuteInvalidTypeCache() ->willReturn(['someCache']); $this->messageManagerMock->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('These cache type(s) don\'t exist: someCache') ->willReturnSelf(); @@ -176,7 +176,7 @@ public function testExecuteWithException() ->willThrowException($exception); $this->messageManagerMock->expects($this->once()) - ->method('addException') + ->method('addExceptionMessage') ->with($exception, 'An error occurred while disabling cache.') ->willReturnSelf(); @@ -216,7 +216,7 @@ public function testExecuteSuccess() ->method('persist'); $this->messageManagerMock->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with('1 cache type(s) disabled.') ->willReturnSelf(); diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/MassEnableTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/MassEnableTest.php index 9b3640193154a..6eac44a564f6d 100644 --- a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/MassEnableTest.php +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/MassEnableTest.php @@ -156,7 +156,7 @@ public function testExecuteInvalidTypeCache() ->willReturn(['someCache']); $this->messageManagerMock->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('These cache type(s) don\'t exist: someCache') ->willReturnSelf(); @@ -176,7 +176,7 @@ public function testExecuteWithException() ->willThrowException($exception); $this->messageManagerMock->expects($this->once()) - ->method('addException') + ->method('addExceptionMessage') ->with($exception, 'An error occurred while enabling cache.') ->willReturnSelf(); @@ -216,7 +216,7 @@ public function testExecuteSuccess() ->method('persist'); $this->messageManagerMock->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with('1 cache type(s) enabled.') ->willReturnSelf(); diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php index e8dcc00345fc6..a985681919f0b 100644 --- a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php @@ -107,7 +107,7 @@ public function testExecute() $this->resultRedirectFactory->expects($this->any())->method('create')->willReturn($this->resultRedirect); $this->messageManager->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with(__('We updated lifetime statistic.')); $this->objectManager->expects($this->any()) diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/System/Account/SaveTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/System/Account/SaveTest.php index 844a821df1c20..a8490d6ba2e58 100644 --- a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/System/Account/SaveTest.php +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/System/Account/SaveTest.php @@ -71,7 +71,7 @@ protected function setUp() ->getMock(); $this->_messagesMock = $this->getMockBuilder(\Magento\Framework\Message\Manager::class) ->disableOriginalConstructor() - ->setMethods(['addSuccess']) + ->setMethods(['addSuccessMessage']) ->getMockForAbstractClass(); $this->_authSessionMock = $this->getMockBuilder(\Magento\Backend\Model\Auth\Session::class) @@ -221,7 +221,7 @@ public function testSaveAction() $this->_requestMock->setParams($requestParams); - $this->_messagesMock->expects($this->once())->method('addSuccess')->with($this->equalTo($testedMessage)); + $this->_messagesMock->expects($this->once())->method('addSuccessMessage')->with($this->equalTo($testedMessage)); $this->_controller->execute(); } From b31a9cf194ae8d14630a3cd4753816811ec7c206 Mon Sep 17 00:00:00 2001 From: Tiago Sampaio Date: Sat, 18 Aug 2018 23:00:06 -0300 Subject: [PATCH 19/95] Replacing type in method name. --- app/code/Magento/Wishlist/Block/AbstractBlock.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/code/Magento/Wishlist/Block/AbstractBlock.php b/app/code/Magento/Wishlist/Block/AbstractBlock.php index 8b4a8df1bf99f..bb8138fb87a3e 100644 --- a/app/code/Magento/Wishlist/Block/AbstractBlock.php +++ b/app/code/Magento/Wishlist/Block/AbstractBlock.php @@ -231,9 +231,21 @@ public function hasDescription($item) * Retrieve formated Date * * @param string $date + * @deprecated * @return string */ public function getFormatedDate($date) + { + return $this->getFormattedDate($date); + } + + /** + * Retrieve formatted Date + * + * @param string $date + * @return string + */ + public function getFormattedDate($date) { return $this->formatDate($date, \IntlDateFormatter::MEDIUM); } From e4ac4a0fe9eab9f7b0e333e18d51699154df8120 Mon Sep 17 00:00:00 2001 From: Tiago Sampaio Date: Sat, 18 Aug 2018 23:05:44 -0300 Subject: [PATCH 20/95] Fixing typo in method name for Magento_Paypal method. --- app/code/Magento/Paypal/Model/AbstractConfig.php | 13 ++++++++++++- app/code/Magento/Paypal/Model/Config.php | 2 +- .../Paypal/Test/Unit/Model/AbstractConfigTest.php | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Paypal/Model/AbstractConfig.php b/app/code/Magento/Paypal/Model/AbstractConfig.php index 3b0f7b974829c..8d002a670a435 100644 --- a/app/code/Magento/Paypal/Model/AbstractConfig.php +++ b/app/code/Magento/Paypal/Model/AbstractConfig.php @@ -224,15 +224,26 @@ protected function _prepareValue($key, $value) */ public function shouldUseUnilateralPayments() { - return $this->getValue('business_account') && !$this->isWppApiAvailabe(); + return $this->getValue('business_account') && !$this->isWppApiAvailable(); } /** * Check whether WPP API credentials are available for this method * + * @deprecated * @return bool */ public function isWppApiAvailabe() + { + return $this->isWppApiAvailable(); + } + + /** + * Check whether WPP API credentials are available for this method + * + * @return bool + */ + public function isWppApiAvailable() { return $this->getValue('api_username') && $this->getValue('api_password') diff --git a/app/code/Magento/Paypal/Model/Config.php b/app/code/Magento/Paypal/Model/Config.php index 34e40ac7509d6..c16b3025e382a 100644 --- a/app/code/Magento/Paypal/Model/Config.php +++ b/app/code/Magento/Paypal/Model/Config.php @@ -677,7 +677,7 @@ public function isMethodAvailable($methodCode = null) } break; case self::METHOD_BILLING_AGREEMENT: - $result = $this->isWppApiAvailabe(); + $result = $this->isWppApiAvailable(); break; } return $result; diff --git a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php index 9ec9318212614..78bd269403b83 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php @@ -189,14 +189,14 @@ public function getValueDataProvider() * * @dataProvider isWppApiAvailabeDataProvider */ - public function testIsWppApiAvailabe($returnMap, $expectedValue) + public function testIsWppApiAvailable($returnMap, $expectedValue) { $this->config->setMethod('paypal_express'); $this->scopeConfigMock->expects($this->any()) ->method('getValue') ->willReturnMap($returnMap); - $this->assertEquals($expectedValue, $this->config->isWppApiAvailabe()); + $this->assertEquals($expectedValue, $this->config->isWppApiAvailable()); } /** From 3e63d7ba5298d18e3401d919ca07254a97f35975 Mon Sep 17 00:00:00 2001 From: Roman Leshchenko Date: Tue, 28 Aug 2018 16:58:05 +0300 Subject: [PATCH 21/95] MAGETWO-72048: Wrong file upload behavior --- .../Adminhtml/Category/Image/Upload.php | 8 -------- .../Cms/Model/Wysiwyg/Images/Storage.php | 8 -------- .../Unit/Model/Wysiwyg/Images/StorageTest.php | 20 +------------------ .../Adminhtml/Downloadable/File/Upload.php | 9 +-------- .../Downloadable/File/UploadTest.php | 16 --------------- .../Magento/Theme/Model/Wysiwyg/Storage.php | 8 -------- .../Test/Unit/Model/Wysiwyg/StorageTest.php | 3 +-- 7 files changed, 3 insertions(+), 69 deletions(-) diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php index 4cc0f2d89d179..e24b142411b83 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php @@ -54,14 +54,6 @@ public function execute() try { $result = $this->imageUploader->saveFileToTmpDir($imageId); - - $result['cookie'] = [ - 'name' => $this->_getSession()->getName(), - 'value' => $this->_getSession()->getSessionId(), - 'lifetime' => $this->_getSession()->getCookieLifetime(), - 'path' => $this->_getSession()->getCookiePath(), - 'domain' => $this->_getSession()->getCookieDomain(), - ]; } catch (\Exception $e) { $result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()]; } diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index dfd55f5346e59..b2ef78bab9909 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -501,14 +501,6 @@ public function uploadFile($targetPath, $type = null) // create thumbnail $this->resizeFile($targetPath . '/' . $uploader->getUploadedFileName(), true); - $result['cookie'] = [ - 'name' => $this->getSession()->getName(), - 'value' => $this->getSession()->getSessionId(), - 'lifetime' => $this->getSession()->getCookieLifetime(), - 'path' => $this->getSession()->getCookiePath(), - 'domain' => $this->getSession()->getCookieDomain(), - ]; - return $result; } diff --git a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php index 2dc98bcefb961..309f08a54aab6 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php @@ -440,14 +440,7 @@ public function testUploadFile() $thumbnailDestination = $thumbnailTargetPath . '/' . $fileName; $type = 'image'; $result = [ - 'result', - 'cookie' => [ - 'name' => 'session_name', - 'value' => '1', - 'lifetime' => '50', - 'path' => 'cookie/path', - 'domain' => 'cookie_domain', - ], + 'result' ]; $uploader = $this->getMockBuilder(\Magento\MediaStorage\Model\File\Uploader::class) ->disableOriginalConstructor() @@ -507,17 +500,6 @@ public function testUploadFile() $this->adapterFactoryMock->expects($this->atLeastOnce())->method('create')->willReturn($image); - $this->sessionMock->expects($this->atLeastOnce())->method('getName') - ->willReturn($result['cookie']['name']); - $this->sessionMock->expects($this->atLeastOnce())->method('getSessionId') - ->willReturn($result['cookie']['value']); - $this->sessionMock->expects($this->atLeastOnce())->method('getCookieLifetime') - ->willReturn($result['cookie']['lifetime']); - $this->sessionMock->expects($this->atLeastOnce())->method('getCookiePath') - ->willReturn($result['cookie']['path']); - $this->sessionMock->expects($this->atLeastOnce())->method('getCookieDomain') - ->willReturn($result['cookie']['domain']); - $this->assertEquals($result, $this->imagesStorage->uploadFile($targetPath, $type)); } } diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index 38444de78ab9c..9019388dfec2d 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -96,17 +96,10 @@ public function execute() $relativePath = rtrim($tmpPath, '/') . '/' . ltrim($result['file'], '/'); $this->storageDatabase->saveFile($relativePath); } - - $result['cookie'] = [ - 'name' => $this->_getSession()->getName(), - 'value' => $this->_getSession()->getSessionId(), - 'lifetime' => $this->_getSession()->getCookieLifetime(), - 'path' => $this->_getSession()->getCookiePath(), - 'domain' => $this->_getSession()->getCookieDomain(), - ]; } catch (\Exception $e) { $result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()]; } + return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setData($result); } } diff --git a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/File/UploadTest.php b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/File/UploadTest.php index df1f127fae313..281fb571ff56f 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/File/UploadTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/File/UploadTest.php @@ -59,11 +59,6 @@ class UploadTest extends \PHPUnit\Framework\TestCase */ protected $fileHelper; - /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Backend\Model\Session - */ - protected $session; - /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Controller\ResultFactory */ @@ -81,9 +76,6 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->session = $this->getMockBuilder(\Magento\Backend\Model\Session::class) - ->disableOriginalConstructor() - ->getMock(); $this->resultFactory = $this->getMockBuilder(\Magento\Framework\Controller\ResultFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) @@ -108,9 +100,6 @@ protected function setUp() $this->context->expects($this->any()) ->method('getRequest') ->will($this->returnValue($this->request)); - $this->context->expects($this->any()) - ->method('getSession') - ->will($this->returnValue($this->session)); $this->context->expects($this->any()) ->method('getResultFactory') ->will($this->returnValue($this->resultFactory)); @@ -154,11 +143,6 @@ public function testExecute() $this->uploaderFactory->expects($this->once())->method('create')->willReturn($uploader); $this->fileHelper->expects($this->once())->method('uploadFromTmp')->willReturn($data); $this->storageDatabase->expects($this->once())->method('saveFile'); - $this->session->expects($this->once())->method('getName')->willReturn('Name'); - $this->session->expects($this->once())->method('getSessionId')->willReturn('SessionId'); - $this->session->expects($this->once())->method('getCookieLifetime')->willReturn('CookieLifetime'); - $this->session->expects($this->once())->method('getCookiePath')->willReturn('CookiePath'); - $this->session->expects($this->once())->method('getCookieDomain')->willReturn('CookieDomain'); $this->resultFactory->expects($this->once())->method('create')->willReturn($resultJson); $resultJson->expects($this->once())->method('setData')->willReturnSelf(); diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index 82206b8eb1c65..eb0412738d1ea 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -127,14 +127,6 @@ public function uploadFile($targetPath) $this->_createThumbnail($targetPath . '/' . $uploader->getUploadedFileName()); - $result['cookie'] = [ - 'name' => $this->_helper->getSession()->getName(), - 'value' => $this->_helper->getSession()->getSessionId(), - 'lifetime' => $this->_helper->getSession()->getCookieLifetime(), - 'path' => $this->_helper->getSession()->getCookiePath(), - 'domain' => $this->_helper->getSession()->getCookieDomain() - ]; - return $result; } diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php index 0951f7b50f289..ddd6ebc43ce83 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php @@ -152,8 +152,7 @@ public function testUploadFile() $this->_helperStorage->expects($this->any())->method('getSession')->will($this->returnValue($session)); $expectedResult = [ - 'not_empty', - 'cookie' => ['name' => null, 'value' => null, 'lifetime' => null, 'path' => null, 'domain' => null], + 'not_empty' ]; $this->assertEquals($expectedResult, $this->_storageModel->uploadFile($this->_storageRoot)); From 73fb7e86f53fd4b97eda2ba748ff180c02879829 Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Fri, 31 Aug 2018 12:55:44 -0500 Subject: [PATCH 22/95] MC-2379: CMS content containing widget directives is not updated when the linked widget directive entities are updated - Implemented IdentityInterface for widget block model --- app/code/Magento/Cms/Block/Widget/Block.php | 74 ++++++++++++++++++--- 1 file changed, 65 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Cms/Block/Widget/Block.php b/app/code/Magento/Cms/Block/Widget/Block.php index d8bd483fae5e4..b339f47f7e328 100644 --- a/app/code/Magento/Cms/Block/Widget/Block.php +++ b/app/code/Magento/Cms/Block/Widget/Block.php @@ -3,14 +3,23 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Cms\Block\Widget; +use Magento\Framework\DataObject\IdentityInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Widget\Block\BlockInterface; +use Magento\Cms\Model\Block as CmsBlock; + /** * Cms Static Block Widget * - * @author Magento Core Team + * @author Magento Core Team */ -class Block extends \Magento\Framework\View\Element\Template implements \Magento\Widget\Block\BlockInterface +class Block extends \Magento\Framework\View\Element\Template implements BlockInterface, IdentityInterface { /** * @var \Magento\Cms\Model\Template\FilterProvider @@ -31,6 +40,11 @@ class Block extends \Magento\Framework\View\Element\Template implements \Magento */ protected $_blockFactory; + /** + * @var CmsBlock + */ + private $block; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Cms\Model\Template\FilterProvider $filterProvider @@ -65,19 +79,61 @@ protected function _beforeToHtml() } self::$_widgetUsageMap[$blockHash] = true; - if ($blockId) { - $storeId = $this->_storeManager->getStore()->getId(); - /** @var \Magento\Cms\Model\Block $block */ - $block = $this->_blockFactory->create(); - $block->setStoreId($storeId)->load($blockId); - if ($block->isActive()) { + $block = $this->getBlock(); + + if ($block && $block->isActive()) { + try { + $storeId = $this->_storeManager->getStore()->getId(); $this->setText( $this->_filterProvider->getBlockFilter()->setStoreId($storeId)->filter($block->getContent()) ); + } catch (NoSuchEntityException $e) { } } - unset(self::$_widgetUsageMap[$blockHash]); return $this; } + + /** + * Get identities of the Cms Block + * + * @return array + */ + public function getIdentities() + { + $block = $this->getBlock(); + + if ($block) { + return $block->getIdentities(); + } + + return []; + } + + /** + * @return CmsBlock|null + */ + private function getBlock(): ?CmsBlock + { + if ($this->block) { + return $this->block; + } + + $blockId = $this->getData('block_id'); + + if ($blockId) { + try { + $storeId = $this->_storeManager->getStore()->getId(); + /** @var \Magento\Cms\Model\Block $block */ + $block = $this->_blockFactory->create(); + $block->setStoreId($storeId)->load($blockId); + $this->block = $block; + + return $block; + } catch (NoSuchEntityException $e) { + } + } + + return null; + } } From 65426cedb2dae45c0253966fe73cc3a31e207c5e Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Fri, 31 Aug 2018 13:57:59 -0500 Subject: [PATCH 23/95] MC-2379: CMS content containing widget directives is not updated when the linked widget directive entities are updated - Added assertion for new behavior --- dev/tests/integration/phpunit.xml.dist | 2 +- .../testsuite/Magento/Cms/Block/Widget/BlockTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/phpunit.xml.dist b/dev/tests/integration/phpunit.xml.dist index dedc144c56799..80549d16780d3 100644 --- a/dev/tests/integration/phpunit.xml.dist +++ b/dev/tests/integration/phpunit.xml.dist @@ -51,7 +51,7 @@ - + diff --git a/dev/tests/integration/testsuite/Magento/Cms/Block/Widget/BlockTest.php b/dev/tests/integration/testsuite/Magento/Cms/Block/Widget/BlockTest.php index 7ee1f569180a2..266fd66bc3db9 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Block/Widget/BlockTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Block/Widget/BlockTest.php @@ -31,5 +31,6 @@ public function testToHtml() $this->assertContains('', $result); $this->assertContains('

Custom variable: "HTML Value".

', $result); + $this->assertSame($cmsBlock->getIdentities(), $block->getIdentities()); } } From 5586e2b5b6afbde2442a1559700c28e8e924658c Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Tue, 4 Sep 2018 13:49:09 -0500 Subject: [PATCH 24/95] MC-2379: CMS content containing widget directives is not updated when the linked widget directive entities are updated - Removed redundant interface --- app/code/Magento/Cms/Block/Widget/Block.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/Cms/Block/Widget/Block.php b/app/code/Magento/Cms/Block/Widget/Block.php index b339f47f7e328..0f77db45cfaf6 100644 --- a/app/code/Magento/Cms/Block/Widget/Block.php +++ b/app/code/Magento/Cms/Block/Widget/Block.php @@ -9,9 +9,7 @@ namespace Magento\Cms\Block\Widget; use Magento\Framework\DataObject\IdentityInterface; -use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Widget\Block\BlockInterface; use Magento\Cms\Model\Block as CmsBlock; /** @@ -19,7 +17,7 @@ * * @author Magento Core Team */ -class Block extends \Magento\Framework\View\Element\Template implements BlockInterface, IdentityInterface +class Block extends \Magento\Framework\View\Element\Template implements IdentityInterface { /** * @var \Magento\Cms\Model\Template\FilterProvider From 460362810653a8ccf011d04254ac100fe29dc6af Mon Sep 17 00:00:00 2001 From: Anthoula Wojczak Date: Tue, 4 Sep 2018 14:33:24 -0500 Subject: [PATCH 25/95] MC-1284: Random failure of AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest on Jenkins - unskip test --- ...inAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index 50441574d7a0d..c3797d758d860 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -17,8 +17,6 @@ - - From fe6d7f8e4e331dc1509ad87f766651cc45aae3ee Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Wed, 5 Sep 2018 16:00:17 +0200 Subject: [PATCH 26/95] API-functional test improvements --- .../GraphQl/Catalog/MediaGalleryTest.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index cb5074bf99cf4..8c55377877c38 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -40,6 +40,7 @@ public function testProductSmallImageUrlWithExistingImage() self::assertArrayHasKey('small_image_url', $response['products']['items'][0]); self::assertContains('magento_image.jpg', $response['products']['items'][0]['small_image_url']); + self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image_url'])); } /** @@ -61,8 +62,24 @@ public function testProductSmallImageUrlWithNoImage() } QUERY; $response = $this->graphQlQuery($query); - self::assertArrayHasKey('small_image_url', $response['products']['items'][0]); self::assertContains('placeholder/small_image.jpg', $response['products']['items'][0]['small_image_url']); + self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image_url'])); + } + + /** + * @param string $url + * @return bool + */ + private function checkImageExists(string $url): bool + { + $connection = curl_init($url); + curl_setopt($connection, CURLOPT_HEADER, true); + curl_setopt($connection, CURLOPT_NOBODY, true); + curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1); + curl_exec($connection); + $responseStatus = curl_getinfo($connection, CURLINFO_HTTP_CODE); + + return $responseStatus === 200 ? true : false; } } From a60e55ddeb0048a68c07f8e8bd2c6d38d8fdac78 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Wed, 5 Sep 2018 16:01:58 +0200 Subject: [PATCH 27/95] Added parameter type in DocBlock --- .../CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php index fa7037c88937c..c845922eeb14c 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php @@ -115,7 +115,7 @@ public function resolve( /** * Retrieves small image from the product gallery image * - * @param $productImages + * @param array $productImages * @return string|null */ private function getSmallImageFromGallery(array $productImages) From 43215c20f9980129244acccf1eebd8a5c592c251 Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Wed, 5 Sep 2018 14:08:05 -0500 Subject: [PATCH 28/95] MC-2379: CMS content containing widget directives is not updated when the linked widget directive entities are updated - Reverted feedback from CR after clarification --- app/code/Magento/Cms/Block/Widget/Block.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Block/Widget/Block.php b/app/code/Magento/Cms/Block/Widget/Block.php index 0f77db45cfaf6..5b4fdfac1f57a 100644 --- a/app/code/Magento/Cms/Block/Widget/Block.php +++ b/app/code/Magento/Cms/Block/Widget/Block.php @@ -11,13 +11,14 @@ use Magento\Framework\DataObject\IdentityInterface; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Cms\Model\Block as CmsBlock; +use Magento\Widget\Block\BlockInterface; /** * Cms Static Block Widget * * @author Magento Core Team */ -class Block extends \Magento\Framework\View\Element\Template implements IdentityInterface +class Block extends \Magento\Framework\View\Element\Template implements BlockInterface, IdentityInterface { /** * @var \Magento\Cms\Model\Template\FilterProvider From 3b9e96360e71b5d38167068b2b1a069ca97dc672 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Tue, 11 Sep 2018 16:24:40 +0300 Subject: [PATCH 29/95] ISSUE-18009: [Forwardport] Cannot create a numeric value attribute option using the REST API. --- .../Magento/Eav/Model/Entity/Attribute/OptionManagement.php | 2 +- .../Api/ProductAttributeOptionManagementInterfaceTest.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php b/app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php index a2c9611d26f5d..8cb8687cd1f1f 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php @@ -153,7 +153,7 @@ protected function validateOption($attribute, $optionId) */ private function getOptionId(\Magento\Eav\Api\Data\AttributeOptionInterface $option) : string { - return $option->getValue() ?: 'new_option'; + return 'id_' . ($option->getValue() ?: 'new_option'); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php index f9442d8b6499a..1d37ea9a2fc6d 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php @@ -111,6 +111,9 @@ public function addDataProvider() 'option_with_value_node_that_starts_with_a_number' => [ array_merge($optionPayload, [AttributeOptionInterface::VALUE => '123_some_text']) ], + 'option_with_value_node_that_is_a_number' => [ + array_merge($optionPayload, [AttributeOptionInterface::VALUE => '123']) + ], ]; } From 6877798f314c0e95820cb024a5a21f115b162a91 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Wed, 12 Sep 2018 13:48:13 +0200 Subject: [PATCH 30/95] Removed area simulation. Resolver improvements --- .../Model/Resolver/Product/SmallImageUrl.php | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php index c845922eeb14c..d60c4268a559c 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php @@ -7,16 +7,15 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; -use Magento\Catalog\Helper\Image as CatalogImageHelper; +use Magento\Catalog\Helper\ImageFactory as CatalogImageHelperFactory; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\ResourceModel\Product\GalleryFactory as GalleryResourceFactory; -use Magento\Framework\App\Area; -use Magento\Framework\App\AreaList; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; /** @@ -30,14 +29,9 @@ class SmallImageUrl implements ResolverInterface private $galleryResourceFactory; /** - * @var AreaList + * @var CatalogImageHelperFactory */ - private $areaList; - - /** - * @var CatalogImageHelper - */ - private $catalogImageHelper; + private $catalogImageHelperFactory; /** * @var ValueFactory @@ -51,21 +45,18 @@ class SmallImageUrl implements ResolverInterface /** * @param ValueFactory $valueFactory - * @param CatalogImageHelper $catalogImageHelper - * @param AreaList $areaList + * @param CatalogImageHelperFactory $catalogImageHelperFactory * @param GalleryResourceFactory $galleryResourceFactory * @param StoreManagerInterface $storeManager */ public function __construct( ValueFactory $valueFactory, - CatalogImageHelper $catalogImageHelper, - AreaList $areaList, + CatalogImageHelperFactory $catalogImageHelperFactory, GalleryResourceFactory $galleryResourceFactory, StoreManagerInterface $storeManager ) { $this->valueFactory = $valueFactory; - $this->catalogImageHelper = $catalogImageHelper; - $this->areaList = $areaList; + $this->catalogImageHelperFactory = $catalogImageHelperFactory; $this->galleryResourceFactory = $galleryResourceFactory; $this->storeManager = $storeManager; } @@ -92,18 +83,21 @@ public function resolve( /* If small_image is not loaded for product, need to load it separately */ if (!$product->getSmallImage()) { $galleryResource = $this->galleryResourceFactory->create(); - $currentStoreId =$this->storeManager->getStore()->getId(); - $productImages = $galleryResource->getProductImages($product, [$currentStoreId]); + $storeIds = [ + Store::DEFAULT_STORE_ID, + $this->storeManager->getStore()->getId() + ]; + $productImages = $galleryResource->getProductImages($product, $storeIds); $productSmallImage = $this->getSmallImageFromGallery($productImages); $product->setSmallImage($productSmallImage); } - /* Design area is necessary to return the correct storefront image URL (or a placeholder) */ - $area = $this->areaList->getArea(Area::AREA_FRONTEND); - $area->load(Area::PART_DESIGN); - - $smallImageURL = $this->catalogImageHelper->init($product, 'product_small_image')->getUrl(); - $product->getMediaAttributes(); + $catalogImageHelper = $this->catalogImageHelperFactory->create(); + $smallImageURL = $catalogImageHelper->init( + $product, + 'product_small_image', + ['type' => 'small_image'] + )->getUrl(); $result = function () use ($smallImageURL) { return $smallImageURL; From 646f2481823837a8bf9095c82c4e635c8aa69392 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Wed, 12 Sep 2018 18:45:38 +0200 Subject: [PATCH 31/95] Declared new type for product images --- .../{SmallImageUrl.php => SmallImage.php} | 62 ++++--------------- .../CatalogGraphQl/etc/schema.graphqls | 10 ++- .../GraphQl/Catalog/MediaGalleryTest.php | 22 ++++--- 3 files changed, 33 insertions(+), 61 deletions(-) rename app/code/Magento/CatalogGraphQl/Model/Resolver/Product/{SmallImageUrl.php => SmallImage.php} (54%) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php similarity index 54% rename from app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php rename to app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php index d60c4268a559c..ef9e88bc77a6c 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImageUrl.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php @@ -9,25 +9,18 @@ use Magento\Catalog\Helper\ImageFactory as CatalogImageHelperFactory; use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ResourceModel\Product\GalleryFactory as GalleryResourceFactory; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\Value; use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; /** * Returns product's small image. If the small image is not set, returns a placeholder */ -class SmallImageUrl implements ResolverInterface +class SmallImage implements ResolverInterface { - /** - * @var GalleryResourceFactory - */ - private $galleryResourceFactory; - /** * @var CatalogImageHelperFactory */ @@ -38,26 +31,18 @@ class SmallImageUrl implements ResolverInterface */ private $valueFactory; - /** - * @var StoreManagerInterface - */ - private $storeManager; - /** * @param ValueFactory $valueFactory * @param CatalogImageHelperFactory $catalogImageHelperFactory - * @param GalleryResourceFactory $galleryResourceFactory * @param StoreManagerInterface $storeManager */ public function __construct( ValueFactory $valueFactory, CatalogImageHelperFactory $catalogImageHelperFactory, - GalleryResourceFactory $galleryResourceFactory, StoreManagerInterface $storeManager ) { $this->valueFactory = $valueFactory; $this->catalogImageHelperFactory = $catalogImageHelperFactory; - $this->galleryResourceFactory = $galleryResourceFactory; $this->storeManager = $storeManager; } @@ -79,47 +64,24 @@ public function resolve( } /** @var Product $product */ $product = $value['model']; - - /* If small_image is not loaded for product, need to load it separately */ - if (!$product->getSmallImage()) { - $galleryResource = $this->galleryResourceFactory->create(); - $storeIds = [ - Store::DEFAULT_STORE_ID, - $this->storeManager->getStore()->getId() - ]; - $productImages = $galleryResource->getProductImages($product, $storeIds); - $productSmallImage = $this->getSmallImageFromGallery($productImages); - $product->setSmallImage($productSmallImage); - } + $imageType = $field->getName(); $catalogImageHelper = $this->catalogImageHelperFactory->create(); - $smallImageURL = $catalogImageHelper->init( + $imageUrl = $catalogImageHelper->init( $product, - 'product_small_image', - ['type' => 'small_image'] + 'product_' . $imageType, + ['type' => $imageType] )->getUrl(); - $result = function () use ($smallImageURL) { - return $smallImageURL; + $imageData = [ + 'url' => $imageUrl, + 'path' => $product->getData($imageType) + ]; + + $result = function () use ($imageData) { + return $imageData; }; return $this->valueFactory->create($result); } - - /** - * Retrieves small image from the product gallery image - * - * @param array $productImages - * @return string|null - */ - private function getSmallImageFromGallery(array $productImages) - { - foreach ($productImages as $productImage) { - if ($productImage['attribute_code'] == 'small_image') { - return $productImage['filepath']; - } - } - - return null; - } } diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 5018795b3197d..b557f7a8da980 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -258,8 +258,7 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ meta_keyword: String @doc(description: "A comma-separated list of keywords that are visible only to search engines") meta_description: String @doc(description: "A brief overview of the product for search results listings, maximum 255 characters") image: String @doc(description: "The relative path to the main image on the product page") - small_image: String @doc(description: "The relative path to the small image, which is used on catalog pages") - small_image_url: String @doc(description: "The small image URL, which is used on catalog pages") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\SmallImageUrl") + small_image: ProductImage @doc(description: "The relative path to the small image, which is used on catalog pages") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\SmallImage") thumbnail: String @doc(description: "The relative path to the product's thumbnail image") new_from_date: String @doc(description: "The beginning date for new product listings, and determines if the product is featured as a new product") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") new_to_date: String @doc(description: "The end date for new product listings") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") @@ -353,6 +352,11 @@ type CustomizableFileValue @doc(description: "CustomizableFileValue defines the image_size_y: Int @doc(description: "The maximum height of an image") } +type ProductImage @doc(description: "Product image information. Contains image relative path and URL") { + url: String + path: String +} + interface CustomizableOptionInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\CustomizableOptionTypeResolver") @doc(description: "The CustomizableOptionInterface contains basic information about a customizable option. It can be implemented by several types of configurable options.") { title: String @doc(description: "The display name for this option") required: Boolean @doc(description: "Indicates whether the option is required") @@ -541,6 +545,6 @@ type SortField { } type SortFields @doc(description: "SortFields contains a default value for sort fields and all available sort fields") { - default: String @doc(description: "Default value of sort fields") + default: String @doc(description: "Default value of sort fields") options: [SortField] @doc(description: "Available sort fields") } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index 8c55377877c38..5d5de67edc820 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -31,16 +31,18 @@ public function testProductSmallImageUrlWithExistingImage() { products(filter: {sku: {eq: "{$productSku}"}}) { items { - small_image_url + small_image { + url + } } } } QUERY; $response = $this->graphQlQuery($query); - self::assertArrayHasKey('small_image_url', $response['products']['items'][0]); - self::assertContains('magento_image.jpg', $response['products']['items'][0]['small_image_url']); - self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image_url'])); + self::assertArrayHasKey('url', $response['products']['items'][0]['small_image']); + self::assertContains('magento_image.jpg', $response['products']['items'][0]['small_image']['url']); + self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); } /** @@ -56,15 +58,19 @@ public function testProductSmallImageUrlWithNoImage() { products(filter: {sku: {eq: "{$productSku}"}}) { items { - small_image_url + small_image { + url + } } } } QUERY; $response = $this->graphQlQuery($query); - self::assertArrayHasKey('small_image_url', $response['products']['items'][0]); - self::assertContains('placeholder/small_image.jpg', $response['products']['items'][0]['small_image_url']); - self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image_url'])); + + var_dump($response['products']['items'][0]); + self::assertArrayHasKey('small_image', $response['products']['items'][0]); + self::assertContains('placeholder/small_image.jpg', $response['products']['items'][0]['small_image']['url']); + self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); } /** From f8b59e704418a8fd89a214a8a3b202cf3a1f07f1 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Wed, 12 Sep 2018 18:46:17 +0200 Subject: [PATCH 32/95] DocBlock comment adjustments --- .../CatalogGraphQl/Model/Resolver/Product/SmallImage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php index ef9e88bc77a6c..aff51cc9326f2 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php @@ -17,7 +17,7 @@ use Magento\Store\Model\StoreManagerInterface; /** - * Returns product's small image. If the small image is not set, returns a placeholder + * Returns product's image. If the image is not set, returns a placeholder */ class SmallImage implements ResolverInterface { From a027ae766649573315cd132893ef1ae0bd714b76 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Thu, 13 Sep 2018 13:02:50 +0200 Subject: [PATCH 33/95] Removed debug parts --- .../testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index 5d5de67edc820..f99ae882e9cd2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -67,7 +67,6 @@ public function testProductSmallImageUrlWithNoImage() QUERY; $response = $this->graphQlQuery($query); - var_dump($response['products']['items'][0]); self::assertArrayHasKey('small_image', $response['products']['items'][0]); self::assertContains('placeholder/small_image.jpg', $response['products']['items'][0]['small_image']['url']); self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); From c53bb4f69dc0c5cf99bc3ae40304aa106713075a Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Thu, 13 Sep 2018 17:26:50 +0200 Subject: [PATCH 34/95] Removed placeholder test --- .../GraphQl/Catalog/MediaGalleryTest.php | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index f99ae882e9cd2..4fe31fd400d3f 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -45,33 +45,6 @@ public function testProductSmallImageUrlWithExistingImage() self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); } - /** - * small_image_url should contain a placeholder when there's no small image assigned - * to the product - * - * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php - */ - public function testProductSmallImageUrlWithNoImage() - { - $productSku = 'simple'; - $query = <<graphQlQuery($query); - - self::assertArrayHasKey('small_image', $response['products']['items'][0]); - self::assertContains('placeholder/small_image.jpg', $response['products']['items'][0]['small_image']['url']); - self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); - } - /** * @param string $url * @return bool From 5a674c74417bb9a08065f584f856df9e8633008a Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Fri, 14 Sep 2018 15:53:22 +0200 Subject: [PATCH 35/95] Making the resolver universal --- .../Product/{SmallImage.php => Image.php} | 15 ++++----------- .../Magento/CatalogGraphQl/etc/schema.graphqls | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) rename app/code/Magento/CatalogGraphQl/Model/Resolver/Product/{SmallImage.php => Image.php} (79%) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php similarity index 79% rename from app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php rename to app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php index aff51cc9326f2..51a63a067e0ba 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/SmallImage.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php @@ -14,12 +14,11 @@ use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Store\Model\StoreManagerInterface; /** - * Returns product's image. If the image is not set, returns a placeholder + * Returns product's image. If the image is not set, returns a placeholder */ -class SmallImage implements ResolverInterface +class Image implements ResolverInterface { /** * @var CatalogImageHelperFactory @@ -34,16 +33,13 @@ class SmallImage implements ResolverInterface /** * @param ValueFactory $valueFactory * @param CatalogImageHelperFactory $catalogImageHelperFactory - * @param StoreManagerInterface $storeManager */ public function __construct( ValueFactory $valueFactory, - CatalogImageHelperFactory $catalogImageHelperFactory, - StoreManagerInterface $storeManager + CatalogImageHelperFactory $catalogImageHelperFactory ) { $this->valueFactory = $valueFactory; $this->catalogImageHelperFactory = $catalogImageHelperFactory; - $this->storeManager = $storeManager; } /** @@ -57,10 +53,7 @@ public function resolve( array $args = null ): Value { if (!isset($value['model'])) { - $result = function () { - return null; - }; - return $this->valueFactory->create($result); + throw new \LogicException(__("Cannot resolve entity model")); } /** @var Product $product */ $product = $value['model']; diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index b557f7a8da980..b626e2c8d22e2 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -258,7 +258,7 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ meta_keyword: String @doc(description: "A comma-separated list of keywords that are visible only to search engines") meta_description: String @doc(description: "A brief overview of the product for search results listings, maximum 255 characters") image: String @doc(description: "The relative path to the main image on the product page") - small_image: ProductImage @doc(description: "The relative path to the small image, which is used on catalog pages") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\SmallImage") + small_image: ProductImage @doc(description: "The relative path to the small image, which is used on catalog pages") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Image") thumbnail: String @doc(description: "The relative path to the product's thumbnail image") new_from_date: String @doc(description: "The beginning date for new product listings, and determines if the product is featured as a new product") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") new_to_date: String @doc(description: "The end date for new product listings") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") From 0ea7d503b257a5851c3665441ebaeacd94d48364 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Fri, 14 Sep 2018 16:02:19 +0200 Subject: [PATCH 36/95] Return scalar type instead of deferred --- .../Model/Resolver/Product/Image.php | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php index 51a63a067e0ba..86b648502718d 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php @@ -10,8 +10,6 @@ use Magento\Catalog\Helper\ImageFactory as CatalogImageHelperFactory; use Magento\Catalog\Model\Product; use Magento\Framework\GraphQl\Config\Element\Field; -use Magento\Framework\GraphQl\Query\Resolver\Value; -use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; @@ -26,19 +24,11 @@ class Image implements ResolverInterface private $catalogImageHelperFactory; /** - * @var ValueFactory - */ - private $valueFactory; - - /** - * @param ValueFactory $valueFactory * @param CatalogImageHelperFactory $catalogImageHelperFactory */ public function __construct( - ValueFactory $valueFactory, CatalogImageHelperFactory $catalogImageHelperFactory ) { - $this->valueFactory = $valueFactory; $this->catalogImageHelperFactory = $catalogImageHelperFactory; } @@ -51,7 +41,7 @@ public function resolve( ResolveInfo $info, array $value = null, array $args = null - ): Value { + ): array { if (!isset($value['model'])) { throw new \LogicException(__("Cannot resolve entity model")); } @@ -66,15 +56,9 @@ public function resolve( ['type' => $imageType] )->getUrl(); - $imageData = [ + return [ 'url' => $imageUrl, 'path' => $product->getData($imageType) ]; - - $result = function () use ($imageData) { - return $imageData; - }; - - return $this->valueFactory->create($result); } } From 3707da5561f942aa46c274a6ab705b87b4c53d8f Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Fri, 14 Sep 2018 14:01:23 -0500 Subject: [PATCH 37/95] MAGETWO-72064: Fix tinymce flash player issue --- pub/static/.htaccess | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pub/static/.htaccess b/pub/static/.htaccess index f49dce25d433e..83ff0bb6db062 100644 --- a/pub/static/.htaccess +++ b/pub/static/.htaccess @@ -22,6 +22,10 @@ Options -MultiViews RewriteCond %{REQUEST_FILENAME} !-l RewriteRule .* ../static.php?resource=$0 [L] + + RewriteCond %{QUERY_STRING} !^$ + RewriteRule ^(.*)$ %{REQUEST_URI}? [R=301,L] + ############################################ From ed9f348f55cb7792bff56d4a89f1fa0dd292e0b5 Mon Sep 17 00:00:00 2001 From: roman Date: Mon, 17 Sep 2018 11:59:20 +0300 Subject: [PATCH 38/95] MAGETWO-72048: Wrong file upload behavior --- .../Controller/Adminhtml/Downloadable/File/Upload.php | 6 +++++- app/code/Magento/Theme/Model/Wysiwyg/Storage.php | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index 9019388dfec2d..a1d489046b144 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -1,6 +1,5 @@ Date: Mon, 17 Sep 2018 14:30:40 +0300 Subject: [PATCH 39/95] add support HTTP DELETE method for async bulk request by adding merging url params with body params --- .../Controller/Rest/Asynchronous/InputParamsResolver.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php b/app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php index e6df38c563ed1..4ebb23f33e97b 100644 --- a/app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php +++ b/app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php @@ -95,6 +95,13 @@ public function resolve() $this->requestValidator->validate(); $webapiResolvedParams = []; $inputData = $this->request->getRequestData(); + + $httpMethod = $this->request->getHttpMethod(); + if ($httpMethod == \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_DELETE) { + $requestBodyParams = $this->request->getBodyParams(); + $inputData = array_merge($requestBodyParams, $inputData); + } + foreach ($inputData as $key => $singleEntityParams) { $webapiResolvedParams[$key] = $this->resolveBulkItemParams($singleEntityParams); } From a4c941e5fa7215e036198bd61c241434c03036ac Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Mon, 17 Sep 2018 14:33:33 +0300 Subject: [PATCH 40/95] GraphQL-88: Small image URL added to the product data -- fix static tests --- .../Magento/CatalogGraphQl/Model/Resolver/Product/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php index 86b648502718d..5fc94eb803607 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php @@ -33,7 +33,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function resolve( Field $field, From a6d7d4594416dea08d2822d9a9d5ed1d16f07a26 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Mon, 17 Sep 2018 14:45:48 +0300 Subject: [PATCH 41/95] GraphQL-88: Small image URL added to the product data -- change exception in image resolver --- .../Magento/CatalogGraphQl/Model/Resolver/Product/Image.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php index 5fc94eb803607..b7ded290f981f 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php @@ -10,6 +10,7 @@ use Magento\Catalog\Helper\ImageFactory as CatalogImageHelperFactory; use Magento\Catalog\Model\Product; use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; @@ -43,7 +44,7 @@ public function resolve( array $args = null ): array { if (!isset($value['model'])) { - throw new \LogicException(__("Cannot resolve entity model")); + throw new GraphQlInputException(__('"model" value should be specified')); } /** @var Product $product */ $product = $value['model']; From ca8c7fc88327b0e47ea44ecf87290978b926c14a Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Mon, 17 Sep 2018 15:25:19 +0200 Subject: [PATCH 42/95] Fixed failing tests --- .../testsuite/Magento/GraphQl/Catalog/CategoryTest.php | 4 +++- .../testsuite/Magento/GraphQl/Catalog/ProductViewTest.php | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php index 8841fab75790c..eff2e96f4b112 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -225,7 +225,9 @@ public function testCategoryProducts() } short_description sku - small_image + small_image { + path + } small_image_label special_from_date special_price diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index 34cebde64d03a..7c2cda3a4551b 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -205,7 +205,9 @@ public function testQueryAllFieldsSimpleProduct() } short_description sku - small_image + small_image { + path + } small_image_label special_from_date special_price @@ -484,7 +486,7 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct() QUERY; $response = $this->graphQlQuery($query); - + /** * @var ProductRepositoryInterface $productRepository */ From 46a988482d37c351320cb1821fd5c5db1e72ab2b Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Mon, 17 Sep 2018 13:39:19 -0500 Subject: [PATCH 43/95] MC-2379: CMS content containing widget directives is not updated - fix static --- app/code/Magento/Cms/Block/Widget/Block.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Block/Widget/Block.php b/app/code/Magento/Cms/Block/Widget/Block.php index 5b4fdfac1f57a..aa6aeaff4ecbe 100644 --- a/app/code/Magento/Cms/Block/Widget/Block.php +++ b/app/code/Magento/Cms/Block/Widget/Block.php @@ -62,8 +62,9 @@ public function __construct( } /** - * Prepare block text and determine whether block output enabled or not - * Prevent blocks recursion if needed + * Prepare block text and determine whether block output enabled or not. + * + * Prevent blocks recursion if needed. * * @return $this */ @@ -110,6 +111,8 @@ public function getIdentities() } /** + * Get block + * * @return CmsBlock|null */ private function getBlock(): ?CmsBlock From b6af9bb5f0f8cb6b6217b62db8568f1901370c3b Mon Sep 17 00:00:00 2001 From: mage2pratik Date: Tue, 18 Sep 2018 00:13:03 +0530 Subject: [PATCH 44/95] Replace sort callbacks to spaceship operator --- .../Magento/Backend/Block/Widget/Button/ButtonList.php | 8 +------- app/code/Magento/Bundle/Model/Product/Type.php | 6 ++---- .../Config/Model/Config/Structure/Mapper/Sorting.php | 6 +----- .../Deploy/Model/DeploymentConfig/ImporterPool.php | 9 +-------- app/code/Magento/Paypal/Model/Express/Checkout.php | 5 +---- .../Sales/Block/Adminhtml/Order/View/Tab/History.php | 6 +----- app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php | 6 +----- app/code/Magento/Ui/DataProvider/Modifier/Pool.php | 9 +-------- .../Test/Constraint/AssertDownloadableDuplicateForm.php | 6 +----- .../Framework/Communication/Config/CompositeReader.php | 6 ++---- 10 files changed, 12 insertions(+), 55 deletions(-) diff --git a/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php b/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php index ced07fb662f14..e2d71d171cf15 100644 --- a/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php +++ b/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php @@ -127,12 +127,6 @@ public function getItems() */ public function sortButtons(Item $itemA, Item $itemB) { - $sortOrderA = (int) $itemA->getSortOrder(); - $sortOrderB = (int) $itemB->getSortOrder(); - - if ($sortOrderA == $sortOrderB) { - return 0; - } - return ($sortOrderA < $sortOrderB) ? -1 : 1; + return (int)$itemA->getSortOrder() <=> (int)$itemB->getSortOrder(); } } diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index a2a02cbd715bd..96e59b9553b28 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -1009,10 +1009,8 @@ public function shakeSelections($firstItem, $secondItem) $secondItem->getPosition(), $secondItem->getSelectionId(), ]; - if ($aPosition == $bPosition) { - return 0; - } - return $aPosition < $bPosition ? -1 : 1; + + return $aPosition <=> $bPosition; } /** diff --git a/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php b/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php index 2733847bab1d0..e615678550108 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php +++ b/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php @@ -62,10 +62,6 @@ protected function _cmp($elementA, $elementB) $sortIndexB = (float)$elementB['sortOrder']; } - if ($sortIndexA == $sortIndexB) { - return 0; - } - - return $sortIndexA < $sortIndexB ? -1 : 1; + return $sortIndexA <=> $sortIndexB; } } diff --git a/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php b/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php index a4a9ef00c4a83..cae76a4c2591f 100644 --- a/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php +++ b/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php @@ -187,14 +187,7 @@ public function getValidator($section) private function sort(array $data) { uasort($data, function (array $a, array $b) { - $a['sort_order'] = $this->getSortOrder($a); - $b['sort_order'] = $this->getSortOrder($b); - - if ($a['sort_order'] == $b['sort_order']) { - return 0; - } - - return ($a['sort_order'] < $b['sort_order']) ? -1 : 1; + return $this->getSortOrder($a) <=> $this->getSortOrder($b); }); return $data; diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 1300c79368943..856e01f7353f2 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -1056,10 +1056,7 @@ protected function _prepareShippingOptions(Address $address, $mayReturnEmpty = f */ protected static function cmpShippingOptions(DataObject $option1, DataObject $option2) { - if ($option1->getAmount() == $option2->getAmount()) { - return 0; - } - return ($option1->getAmount() < $option2->getAmount()) ? -1 : 1; + return $option1->getAmount() <=> $option2->getAmount(); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php index 64b53d10d4af6..30b0872dfa90d 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php @@ -303,11 +303,7 @@ public static function sortHistoryByTimestamp($a, $b) $createdAtA = $a['created_at']; $createdAtB = $b['created_at']; - /** @var $createdAtA \DateTime */ - if ($createdAtA->getTimestamp() == $createdAtB->getTimestamp()) { - return 0; - } - return $createdAtA->getTimestamp() < $createdAtB->getTimestamp() ? -1 : 1; + return $createdAtA->getTimestamp() <=> $createdAtB->getTimestamp(); } /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index 401fdcd2b04ac..2989e8a95c198 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -641,11 +641,7 @@ protected function _sortTotalsList($a, $b) return 0; } - if ($a['sort_order'] == $b['sort_order']) { - return 0; - } - - return $a['sort_order'] > $b['sort_order'] ? 1 : -1; + return $a['sort_order'] <=> $b['sort_order']; } /** diff --git a/app/code/Magento/Ui/DataProvider/Modifier/Pool.php b/app/code/Magento/Ui/DataProvider/Modifier/Pool.php index 34a24499834d2..882f97d57e9fb 100644 --- a/app/code/Magento/Ui/DataProvider/Modifier/Pool.php +++ b/app/code/Magento/Ui/DataProvider/Modifier/Pool.php @@ -88,14 +88,7 @@ public function getModifiersInstances() protected function sort(array $data) { usort($data, function (array $a, array $b) { - $a['sortOrder'] = $this->getSortOrder($a); - $b['sortOrder'] = $this->getSortOrder($b); - - if ($a['sortOrder'] == $b['sortOrder']) { - return 0; - } - - return ($a['sortOrder'] < $b['sortOrder']) ? -1 : 1; + return $this->getSortOrder($a) <=> $this->getSortOrder($b); }); return $data; diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php index e5d97e1511e71..2033189214e12 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php @@ -32,11 +32,7 @@ protected function sortDownloadableArray(array $fields) usort( $fields, function ($row1, $row2) { - if ($row1['sort_order'] == $row2['sort_order']) { - return 0; - } - - return ($row1['sort_order'] < $row2['sort_order']) ? -1 : 1; + return $row1['sort_order'] <=> $row2['sort_order']; } ); diff --git a/lib/internal/Magento/Framework/Communication/Config/CompositeReader.php b/lib/internal/Magento/Framework/Communication/Config/CompositeReader.php index f3af691426919..2ca64bf14d33b 100644 --- a/lib/internal/Magento/Framework/Communication/Config/CompositeReader.php +++ b/lib/internal/Magento/Framework/Communication/Config/CompositeReader.php @@ -27,12 +27,10 @@ public function __construct(array $readers) usort( $readers, function ($firstItem, $secondItem) { - if (!isset($firstItem['sortOrder']) || !isset($secondItem['sortOrder']) - || $firstItem['sortOrder'] == $secondItem['sortOrder'] - ) { + if (!isset($firstItem['sortOrder']) || !isset($secondItem['sortOrder'])) { return 0; } - return $firstItem['sortOrder'] < $secondItem['sortOrder'] ? -1 : 1; + return $firstItem['sortOrder'] <=> $secondItem['sortOrder']; } ); $this->readers = []; From 430084d000ea484d980f350254d12569549e4468 Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Mon, 17 Sep 2018 13:53:42 -0500 Subject: [PATCH 45/95] =?UTF-8?q?MAGETWO-91034:=20Renaming=20of=20new=20se?= =?UTF-8?q?tup=20commands=20and=20setup:install/setup=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix static --- .../Console/Command/GeneratePatchCommand.php | 4 ++-- .../Command/TablesWhitelistGenerateCommand.php | 6 ++++-- .../Declaration/Schema/Diff/DiffInterface.php | 6 +++--- .../Setup/Console/Command/InstallCommand.php | 6 +++--- .../Setup/Console/Command/UpgradeCommand.php | 3 +-- setup/src/Magento/Setup/Model/Installer.php | 16 +++++++++------- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php b/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php index a417f688e1144..15cad9586c2be 100644 --- a/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php +++ b/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php @@ -48,7 +48,7 @@ public function __construct(ComponentRegistrar $componentRegistrar) } /** - * {@inheritdoc} + * @inheritdoc * @throws InvalidArgumentException */ protected function configure() @@ -96,7 +96,7 @@ private function getPatchTemplate() : string } /** - * {@inheritdoc} + * @inheritdoc * @throws \InvalidArgumentException */ protected function execute(InputInterface $input, OutputInterface $output) : int diff --git a/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php b/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php index a2200b84a70bc..b30edc0c7976f 100644 --- a/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php +++ b/app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php @@ -20,6 +20,7 @@ /** * Command that allows to generate whitelist, that will be used, when declaration data is installed. + * * If whitelist already exists, new values will be added to existing whitelist. */ class TablesWhitelistGenerateCommand extends Command @@ -148,8 +149,9 @@ protected function execute(InputInterface $input, OutputInterface $output) : int } /** - * As for whitelist we do not need any specific attributes like nullable or indexType, - * we need to choose only names. + * Filter attribute names + * + * As for whitelist we do not need any specific attributes like nullable or indexType, we need to choose only names. * * @param array $content * @return array diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/DiffInterface.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/DiffInterface.php index c24b861aca2cd..139e9b902684a 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/DiffInterface.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/DiffInterface.php @@ -36,9 +36,9 @@ public function getAll(); /** * Register operation. * - * @param ElementInterface|object $dtoObject - * @param string $operation - * @param ElementInterface $oldDtoObject + * @param ElementInterface|object $dtoObject + * @param string $operation + * @param ElementInterface $oldDtoObject * @return void */ public function register( diff --git a/setup/src/Magento/Setup/Console/Command/InstallCommand.php b/setup/src/Magento/Setup/Console/Command/InstallCommand.php index 1ebf78dfea2f4..7e767292b36e8 100644 --- a/setup/src/Magento/Setup/Console/Command/InstallCommand.php +++ b/setup/src/Magento/Setup/Console/Command/InstallCommand.php @@ -130,7 +130,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ protected function configure() { @@ -210,7 +210,7 @@ protected function configure() } /** - * {@inheritdoc} + * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { @@ -225,7 +225,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } /** - * {@inheritdoc} + * @inheritdoc */ protected function initialize(InputInterface $input, OutputInterface $output) { diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index 15d55c31118b0..2df8cde086553 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -47,10 +47,9 @@ class UpgradeCommand extends AbstractSetupCommand private $appState; /** - * Constructor. - * * @param InstallerFactory $installerFactory * @param DeploymentConfig $deploymentConfig + * @param AppState|null $appState */ public function __construct( InstallerFactory $installerFactory, diff --git a/setup/src/Magento/Setup/Model/Installer.php b/setup/src/Magento/Setup/Model/Installer.php index 1739805b3bceb..394725472578f 100644 --- a/setup/src/Magento/Setup/Model/Installer.php +++ b/setup/src/Magento/Setup/Model/Installer.php @@ -268,7 +268,6 @@ class Installer * @param ComponentRegistrar $componentRegistrar * @param PhpReadinessCheck $phpReadinessCheck * - * @param DeclarationInstaller|null $declarationInstaller * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -410,7 +409,7 @@ private function writeInstallationDate() } /** - * Creates modules deployment configuration segment + * Create modules deployment configuration segment * * @param \ArrayObject|array $request * @param bool $dryRun @@ -904,9 +903,9 @@ private function throwExceptionForNotWritablePaths(array $paths) } /** - * Handles database schema and data (install/upgrade/backup/uninstall etc) + * Handle database schema and data (install/upgrade/backup/uninstall etc) * - * @param SchemaSetupInterface | ModuleDataSetupInterface $setup + * @param SchemaSetupInterface|ModuleDataSetupInterface $setup * @param string $type * @param array $request * @return void @@ -1027,6 +1026,8 @@ private function handleDBSchemaData($setup, $type, array $request) } /** + * Assert DbConfigExists + * * @return void * @throws \Magento\Setup\Exception */ @@ -1082,7 +1083,8 @@ public function installUserConfig($data) } /** - * Creates data handler + * Create data handler + * * @param string $className * @param string $interfaceName * @return mixed|null @@ -1101,7 +1103,7 @@ protected function createSchemaDataHandler($className, $interfaceName) } /** - * Creates store order increment prefix configuration + * Create store order increment prefix configuration * * @param string $orderIncrementPrefix Value to use for order increment prefix * @return void @@ -1145,7 +1147,7 @@ private function installOrderIncrementPrefix($orderIncrementPrefix) } /** - * Creates admin account + * Create admin account * * @param \ArrayObject|array $data * @return void From dfffe34707e5a338118a3522c6759299d4390af8 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Mon, 17 Sep 2018 13:58:57 -0500 Subject: [PATCH 46/95] MAGETWO-72064: Fix tinymce flash player issue --- pub/static/.htaccess | 1 + 1 file changed, 1 insertion(+) diff --git a/pub/static/.htaccess b/pub/static/.htaccess index 83ff0bb6db062..a5aa6fb0d5cfd 100644 --- a/pub/static/.htaccess +++ b/pub/static/.htaccess @@ -22,6 +22,7 @@ Options -MultiViews RewriteCond %{REQUEST_FILENAME} !-l RewriteRule .* ../static.php?resource=$0 [L] + # Detects if moxieplayer request with uri params and redirects to uri without params RewriteCond %{QUERY_STRING} !^$ RewriteRule ^(.*)$ %{REQUEST_URI}? [R=301,L] From 53c015148b3c0bf2603693b7e66f237e58cca498 Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Mon, 17 Sep 2018 19:20:17 -0500 Subject: [PATCH 47/95] =?UTF-8?q?MC-2379:=20CMS=20content=20containing=20w?= =?UTF-8?q?idget=20directives=20is=20not=20updated=20when=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - revert dist file --- dev/tests/integration/phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/phpunit.xml.dist b/dev/tests/integration/phpunit.xml.dist index 80549d16780d3..dedc144c56799 100644 --- a/dev/tests/integration/phpunit.xml.dist +++ b/dev/tests/integration/phpunit.xml.dist @@ -51,7 +51,7 @@ - + From 648d7d8cd574096f7241eeaeb9ff5beffca44e68 Mon Sep 17 00:00:00 2001 From: roman Date: Tue, 18 Sep 2018 15:43:53 +0300 Subject: [PATCH 48/95] MAGETWO-72048: Wrong file upload behavior --- .../Controller/Adminhtml/Downloadable/File/Upload.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index a1d489046b144..83b2797050db9 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -5,6 +5,7 @@ */ namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\File; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; /** @@ -12,7 +13,7 @@ * * @package Magento\Downloadable\Controller\Adminhtml\Downloadable\File */ -class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File +class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpPostActionInterface { /** * @var \Magento\Downloadable\Model\Link From e52c76486828f8c2eaec9c4c91566cd309124ed3 Mon Sep 17 00:00:00 2001 From: roman Date: Tue, 18 Sep 2018 15:44:00 +0300 Subject: [PATCH 49/95] MAGETWO-72048: Wrong file upload behavior --- .../Catalog/Controller/Adminhtml/Category/Image/Upload.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php index e24b142411b83..d1efa0014d42d 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php @@ -5,12 +5,13 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Category\Image; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; /** * Class Upload */ -class Upload extends \Magento\Backend\App\Action +class Upload extends \Magento\Backend\App\Action implements HttpPostActionInterface { /** * Image uploader From 568fa46a9c5ec3bb7de2746ea168e16b90eb1aba Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun Date: Tue, 18 Sep 2018 15:44:00 +0300 Subject: [PATCH 50/95] Change sort order for customer group options #18101 --- .../Customer/Model/GroupManagement.php | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Customer/Model/GroupManagement.php b/app/code/Magento/Customer/Model/GroupManagement.php index 47d7d7ad1ac41..73396edec6622 100644 --- a/app/code/Magento/Customer/Model/GroupManagement.php +++ b/app/code/Magento/Customer/Model/GroupManagement.php @@ -8,14 +8,16 @@ namespace Magento\Customer\Model; use Magento\Customer\Api\Data\GroupInterface; +use Magento\Customer\Api\Data\GroupInterfaceFactory; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Framework\Api\FilterBuilder; use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\Framework\Api\SortOrderBuilder; use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\Api\FilterBuilder; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Data\Collection; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Store\Model\StoreManagerInterface; -use Magento\Customer\Api\GroupRepositoryInterface; -use Magento\Customer\Api\Data\GroupInterfaceFactory; -use Magento\Customer\Model\GroupFactory; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -65,6 +67,11 @@ class GroupManagement implements \Magento\Customer\Api\GroupManagementInterface */ protected $filterBuilder; + /** + * @var SortOrderBuilder + */ + private $sortOrderBuilder; + /** * @param StoreManagerInterface $storeManager * @param ScopeConfigInterface $scopeConfig @@ -73,6 +80,7 @@ class GroupManagement implements \Magento\Customer\Api\GroupManagementInterface * @param GroupInterfaceFactory $groupDataFactory * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param FilterBuilder $filterBuilder + * @param SortOrderBuilder $sortOrderBuilder */ public function __construct( StoreManagerInterface $storeManager, @@ -81,7 +89,8 @@ public function __construct( GroupRepositoryInterface $groupRepository, GroupInterfaceFactory $groupDataFactory, SearchCriteriaBuilder $searchCriteriaBuilder, - FilterBuilder $filterBuilder + FilterBuilder $filterBuilder, + SortOrderBuilder $sortOrderBuilder = null ) { $this->storeManager = $storeManager; $this->scopeConfig = $scopeConfig; @@ -90,6 +99,8 @@ public function __construct( $this->groupDataFactory = $groupDataFactory; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->filterBuilder = $filterBuilder; + $this->sortOrderBuilder = $sortOrderBuilder ?: ObjectManager::getInstance() + ->get(SortOrderBuilder::class); } /** @@ -155,9 +166,14 @@ public function getLoggedInGroups() ->setConditionType('neq') ->setValue(self::CUST_GROUP_ALL) ->create(); + $groupNameSortOrder = $this->sortOrderBuilder + ->setField('customer_group_code') + ->setDirection(Collection::SORT_ORDER_ASC) + ->create(); $searchCriteria = $this->searchCriteriaBuilder ->addFilters($notLoggedInFilter) ->addFilters($groupAll) + ->addSortOrder($groupNameSortOrder) ->create(); return $this->groupRepository->getList($searchCriteria)->getItems(); } From f4ec3348231b5bde57eea4643dacacc504f6662e Mon Sep 17 00:00:00 2001 From: roman Date: Tue, 18 Sep 2018 17:45:00 +0300 Subject: [PATCH 51/95] MAGETWO-72048: Wrong file upload behavior --- .../Controller/Adminhtml/Downloadable/File/Upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index 83b2797050db9..c593651209047 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -5,7 +5,7 @@ */ namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\File; -use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\Controller\ResultFactory; /** @@ -13,7 +13,7 @@ * * @package Magento\Downloadable\Controller\Adminhtml\Downloadable\File */ -class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpPostActionInterface +class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpGetActionInterface { /** * @var \Magento\Downloadable\Model\Link From 6d6158e32105b2dd54894f1b172727d3741ea146 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun Date: Tue, 18 Sep 2018 18:23:05 +0300 Subject: [PATCH 52/95] MAGETWO-88591: Deleting Stores --- .../Controller/Adminhtml/System/Store/DeleteGroupPost.php | 8 ++++++-- .../Controller/Adminhtml/System/Store/DeleteStorePost.php | 7 +++++-- .../Adminhtml/System/Store/DeleteWebsitePost.php | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php index 23364aac1f0ab..49c327060dae5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php @@ -1,16 +1,20 @@ Date: Tue, 18 Sep 2018 19:33:16 +0300 Subject: [PATCH 53/95] MAGETWO-88591: Deleting Stores --- .../Controller/Adminhtml/System/Store/DeleteWebsitePost.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php index f6f265a745500..3fee1a25c9fe4 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php @@ -8,6 +8,7 @@ use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; + /** * Delete website. */ From e74648058a77dd687eb73c73db6a44a8dcac5eba Mon Sep 17 00:00:00 2001 From: vagrant Date: Sat, 23 Jun 2018 01:04:33 +0200 Subject: [PATCH 54/95] Fix setting billing address twice. Instead, set shipping address also. Additionally, improve code style slightly. --- .../testsuite/Magento/Sales/_files/order_list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php index 43e98419798a8..23283e53e4202 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php @@ -8,10 +8,10 @@ require 'order.php'; /** @var Order $order */ -/** @var Order\Payment $payment */ -/** @var Order\Item $orderItem */ -/** @var Order\Address $billingAddress */ -/** @var Order\Address $shippingAddress */ +/** @var Order\Payment $payment */ +/** @var Order\Item $orderItem */ +/** @var Order\Address $billingAddress */ +/** @var Order\Address $shippingAddress */ $orders = [ [ 'increment_id' => '100000002', @@ -58,6 +58,6 @@ ->setData($orderData) ->addItem($orderItem) ->setBillingAddress($billingAddress) - ->setBillingAddress($shippingAddress) + ->setShippingAddress($shippingAddress) ->save(); } From 1481591bbe04db3f262362b7ff386d522c8ad494 Mon Sep 17 00:00:00 2001 From: vagrant Date: Sat, 23 Jun 2018 09:25:33 +0200 Subject: [PATCH 55/95] Reset addresses for each order. Otherwise they cannot be accessed. --- .../testsuite/Magento/Sales/_files/order_list.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php index 23283e53e4202..f841658e3242c 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php @@ -54,6 +54,14 @@ $order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( \Magento\Sales\Model\Order::class ); + + // Reset addresses + $billingAddress = $objectManager->create(\Magento\Sales\Model\Order\Address::class, ['data' => $addressData]); + $billingAddress->setAddressType('billing'); + + $shippingAddress = clone $billingAddress; + $shippingAddress->setId(null)->setAddressType('shipping'); + $order ->setData($orderData) ->addItem($orderItem) From cb578e741103483a068cd16e8a7bcfbc11dcb16e Mon Sep 17 00:00:00 2001 From: vagrant Date: Sat, 23 Jun 2018 09:33:35 +0200 Subject: [PATCH 56/95] Improve var tags. --- .../testsuite/Magento/Sales/_files/order_list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php index f841658e3242c..2789c8040f353 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php @@ -10,8 +10,7 @@ /** @var Order $order */ /** @var Order\Payment $payment */ /** @var Order\Item $orderItem */ -/** @var Order\Address $billingAddress */ -/** @var Order\Address $shippingAddress */ +/** @var array $addressData Data for creating addresses for the orders. */ $orders = [ [ 'increment_id' => '100000002', @@ -56,9 +55,11 @@ ); // Reset addresses + /** @var Order\Address $billingAddress */ $billingAddress = $objectManager->create(\Magento\Sales\Model\Order\Address::class, ['data' => $addressData]); $billingAddress->setAddressType('billing'); + /** @var Order\Address $shippingAddress */ $shippingAddress = clone $billingAddress; $shippingAddress->setId(null)->setAddressType('shipping'); From d4d23fd42adfec7c39e51d698fffa55a060b68c6 Mon Sep 17 00:00:00 2001 From: Volodymyr Hryvinskyi Date: Wed, 19 Sep 2018 00:08:44 +0300 Subject: [PATCH 57/95] Update db schema comments --- app/code/Magento/Bundle/etc/db_schema.xml | 38 +++---- app/code/Magento/Catalog/etc/db_schema.xml | 33 +++--- .../Magento/CatalogRule/etc/db_schema.xml | 8 +- app/code/Magento/Cms/etc/db_schema.xml | 7 +- app/code/Magento/Customer/etc/db_schema.xml | 64 +++++------ app/code/Magento/Eav/etc/db_schema.xml | 14 +-- .../Magento/Integration/etc/db_schema.xml | 2 +- .../NewRelicReporting/etc/db_schema.xml | 10 +- app/code/Magento/Paypal/etc/db_schema.xml | 2 +- app/code/Magento/Quote/etc/db_schema.xml | 4 +- app/code/Magento/Review/etc/db_schema.xml | 12 +- app/code/Magento/Sales/etc/db_schema.xml | 104 +++++++++--------- app/code/Magento/SalesRule/etc/db_schema.xml | 11 +- app/code/Magento/Signifyd/etc/db_schema.xml | 3 +- app/code/Magento/Vault/etc/db_schema.xml | 2 +- app/code/Magento/Weee/etc/db_schema.xml | 2 +- 16 files changed, 162 insertions(+), 154 deletions(-) diff --git a/app/code/Magento/Bundle/etc/db_schema.xml b/app/code/Magento/Bundle/etc/db_schema.xml index 8092f34c533fa..f1c1e7ae782dc 100644 --- a/app/code/Magento/Bundle/etc/db_schema.xml +++ b/app/code/Magento/Bundle/etc/db_schema.xml @@ -120,11 +120,11 @@ + comment="Entity ID"/> + comment="Customer Group ID"/> + comment="Entity ID"/> + comment="Website ID"/> + comment="Stock ID"/> + comment="Entity ID"/> + comment="Website ID"/> + default="0" comment="Tax Class ID"/> + comment="Entity ID"/> + comment="Website ID"/> + default="0" comment="Tax Class ID"/> + comment="Entity ID"/> + comment="Website ID"/> + comment="Entity ID"/> + comment="Website ID"/> + comment="Entity ID"/> + comment="Website ID"/> + comment="Entity ID"/> + comment="Website ID"/>
+ comment="Entity ID"/> @@ -41,7 +41,7 @@ + default="0" comment="Entity ID"/> @@ -76,7 +76,7 @@ + default="0" comment="Entity ID"/> @@ -112,7 +112,7 @@ + default="0" comment="Entity ID"/> @@ -148,7 +148,7 @@ + default="0" comment="Entity ID"/> @@ -183,7 +183,7 @@ + default="0" comment="Entity ID"/> @@ -218,7 +218,7 @@ + default="0" comment="Entity ID"/> @@ -251,7 +251,7 @@
+ comment="Entity ID"/> + default="0" comment="Entity ID"/> @@ -324,7 +324,7 @@ + default="0" comment="Entity ID"/> @@ -363,7 +363,7 @@ + default="0" comment="Entity ID"/> @@ -402,7 +402,7 @@ + default="0" comment="Entity ID"/> @@ -440,7 +440,7 @@ + default="0" comment="Entity ID"/> @@ -738,7 +738,7 @@ + default="0" comment="Entity ID"/> + default="0" comment="Entity ID"/> @@ -1651,7 +1651,8 @@ comment="Link Media value to Product entity table"> - +
+ comment="Entity ID"/> @@ -137,7 +137,8 @@
- + @@ -156,7 +157,8 @@
- + diff --git a/app/code/Magento/Cms/etc/db_schema.xml b/app/code/Magento/Cms/etc/db_schema.xml index 2b825544f56f1..3f97a94d54943 100644 --- a/app/code/Magento/Cms/etc/db_schema.xml +++ b/app/code/Magento/Cms/etc/db_schema.xml @@ -9,7 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
+ comment="Entity ID"/> @@ -46,7 +46,7 @@
+ comment="Entity ID"/> @@ -86,7 +86,8 @@
- + diff --git a/app/code/Magento/Customer/etc/db_schema.xml b/app/code/Magento/Customer/etc/db_schema.xml index 368ca417432fd..657083b58e1b1 100644 --- a/app/code/Magento/Customer/etc/db_schema.xml +++ b/app/code/Magento/Customer/etc/db_schema.xml @@ -9,15 +9,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
+ comment="Entity ID"/> + comment="Website ID"/> + default="0" comment="Group ID"/> + default="0" comment="Store ID"/>
+ comment="Entity ID"/> + comment="Parent ID"/> + default="0" comment="Entity ID"/> @@ -159,7 +159,7 @@ + default="0" comment="Entity ID"/> @@ -186,11 +186,11 @@
+ comment="Value ID"/> + default="0" comment="Attribute ID"/> + default="0" comment="Entity ID"/> @@ -218,11 +218,11 @@
+ comment="Value ID"/> + default="0" comment="Attribute ID"/> + default="0" comment="Entity ID"/> @@ -244,11 +244,11 @@
+ comment="Value ID"/> + default="0" comment="Attribute ID"/> + default="0" comment="Entity ID"/> @@ -274,11 +274,11 @@
+ comment="Value ID"/> + default="0" comment="Attribute ID"/> + default="0" comment="Entity ID"/> @@ -304,11 +304,11 @@
+ comment="Value ID"/> + default="0" comment="Attribute ID"/> + default="0" comment="Entity ID"/> @@ -335,11 +335,11 @@
+ comment="Value ID"/> + default="0" comment="Attribute ID"/> + default="0" comment="Entity ID"/> @@ -366,11 +366,11 @@
+ comment="Value ID"/> + default="0" comment="Attribute ID"/> + default="0" comment="Entity ID"/> @@ -391,11 +391,11 @@
+ comment="Value ID"/> + default="0" comment="Attribute ID"/> + default="0" comment="Entity ID"/> diff --git a/app/code/Magento/Eav/etc/db_schema.xml b/app/code/Magento/Eav/etc/db_schema.xml index f930321e5259b..e81fad5ebded8 100644 --- a/app/code/Magento/Eav/etc/db_schema.xml +++ b/app/code/Magento/Eav/etc/db_schema.xml @@ -15,7 +15,7 @@ - +
+ comment="Entity ID"/> + default="0" comment="Entity ID"/> @@ -123,7 +123,7 @@ + default="0" comment="Entity ID"/> @@ -164,7 +164,7 @@ + default="0" comment="Entity ID"/> @@ -204,7 +204,7 @@ + default="0" comment="Entity ID"/> @@ -241,7 +241,7 @@ + default="0" comment="Entity ID"/> diff --git a/app/code/Magento/Integration/etc/db_schema.xml b/app/code/Magento/Integration/etc/db_schema.xml index 9e81b867d36d5..33173df4f6c0b 100644 --- a/app/code/Magento/Integration/etc/db_schema.xml +++ b/app/code/Magento/Integration/etc/db_schema.xml @@ -9,7 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
+ comment="Entity ID"/> + comment="Entity ID"/> @@ -35,9 +35,9 @@
+ comment="Entity ID"/> + comment="Customer ID"/>
+ comment="Entity ID"/>
+ comment="Entity ID"/> + comment="Entity ID"/> diff --git a/app/code/Magento/Quote/etc/db_schema.xml b/app/code/Magento/Quote/etc/db_schema.xml index 3bd7122e65d7f..725825e976ad7 100644 --- a/app/code/Magento/Quote/etc/db_schema.xml +++ b/app/code/Magento/Quote/etc/db_schema.xml @@ -9,7 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
+ comment="Entity ID"/>
+ comment="Entity ID"/> diff --git a/app/code/Magento/Review/etc/db_schema.xml b/app/code/Magento/Review/etc/db_schema.xml index 1a2ff588180ce..2ae43ea608eca 100644 --- a/app/code/Magento/Review/etc/db_schema.xml +++ b/app/code/Magento/Review/etc/db_schema.xml @@ -95,7 +95,7 @@ + default="0" comment="Store ID"/> @@ -108,9 +108,9 @@
+ comment="Review ID"/> + comment="Store ID"/> @@ -125,7 +125,7 @@
+ comment="Entity ID"/> @@ -136,9 +136,9 @@
+ comment="Rating ID"/> + default="0" comment="Entity ID"/> diff --git a/app/code/Magento/Sales/etc/db_schema.xml b/app/code/Magento/Sales/etc/db_schema.xml index 4b716e761094c..fda6e75cf00c6 100644 --- a/app/code/Magento/Sales/etc/db_schema.xml +++ b/app/code/Magento/Sales/etc/db_schema.xml @@ -9,7 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
+ comment="Entity ID"/> @@ -297,13 +297,13 @@
+ comment="Entity ID"/> + comment="Store ID"/> + comment="Customer ID"/>
+ comment="Entity ID"/> + comment="Parent ID"/> + comment="Customer Address ID"/> + comment="Quote Address ID"/> + comment="Region ID"/> + comment="Customer ID"/> @@ -431,9 +431,9 @@
+ comment="Entity ID"/> + comment="Parent ID"/>
+ comment="Entity ID"/> + comment="Parent ID"/>
+ comment="Entity ID"/> + comment="Store ID"/> + comment="Order ID"/> + comment="Customer ID"/> + comment="Shipping Address ID"/> + comment="Billing Address ID"/> @@ -762,13 +762,13 @@
+ comment="Entity ID"/> + comment="Store ID"/> + comment="Order ID"/> @@ -837,9 +837,9 @@
+ comment="Entity ID"/> + comment="Parent ID"/> + comment="Product ID"/> + comment="Order Item ID"/> @@ -867,14 +867,14 @@
+ comment="Entity ID"/> + comment="Parent ID"/> + comment="Order ID"/> @@ -901,9 +901,9 @@
+ comment="Entity ID"/> + comment="Parent ID"/>
+ comment="Entity ID"/> + comment="Store ID"/>
+ comment="Entity ID"/> + comment="Store ID"/> + comment="Order ID"/> @@ -1136,9 +1136,9 @@
+ comment="Entity ID"/> + comment="Parent ID"/>
+ comment="Entity ID"/> + comment="Parent ID"/>
+ comment="Entity ID"/> + comment="Store ID"/>
+ comment="Entity ID"/> + comment="Order ID"/> @@ -1366,7 +1366,7 @@ comment="Base Grand Total"/> + comment="Store ID"/> @@ -1438,9 +1438,9 @@
+ comment="Entity ID"/> + comment="Parent ID"/> + comment="Product ID"/> + comment="Order Item ID"/> @@ -1494,9 +1494,9 @@
+ comment="Entity ID"/> + comment="Parent ID"/>
+ comment="Entity ID"/> @@ -163,7 +163,8 @@
- +
- + @@ -336,7 +338,8 @@
- + diff --git a/app/code/Magento/Signifyd/etc/db_schema.xml b/app/code/Magento/Signifyd/etc/db_schema.xml index 6a31eacbb45f5..6f41b883c71e1 100644 --- a/app/code/Magento/Signifyd/etc/db_schema.xml +++ b/app/code/Magento/Signifyd/etc/db_schema.xml @@ -37,6 +37,7 @@
- +
diff --git a/app/code/Magento/Vault/etc/db_schema.xml b/app/code/Magento/Vault/etc/db_schema.xml index ed1f2adba2142..e9645e211ae9b 100644 --- a/app/code/Magento/Vault/etc/db_schema.xml +++ b/app/code/Magento/Vault/etc/db_schema.xml @@ -9,7 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> + comment="Entity ID"/> + default="0" comment="Entity ID"/> From ed994905103bc3824e940b96cf72239a33d932b4 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Wed, 19 Sep 2018 14:42:51 +0200 Subject: [PATCH 58/95] Minor code style fixes --- app/code/Magento/Customer/Model/GroupManagement.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Customer/Model/GroupManagement.php b/app/code/Magento/Customer/Model/GroupManagement.php index 73396edec6622..eb5d90f2fd7ea 100644 --- a/app/code/Magento/Customer/Model/GroupManagement.php +++ b/app/code/Magento/Customer/Model/GroupManagement.php @@ -20,6 +20,8 @@ use Magento\Store\Model\StoreManagerInterface; /** + * The class contains methods for getting information about a customer group + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class GroupManagement implements \Magento\Customer\Api\GroupManagementInterface @@ -104,7 +106,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function isReadonly($groupId) { @@ -118,7 +120,7 @@ public function isReadonly($groupId) } /** - * {@inheritdoc} + * @inheritdoc */ public function getDefaultGroup($storeId = null) { @@ -144,7 +146,7 @@ public function getDefaultGroup($storeId = null) } /** - * {@inheritdoc} + * @inheritdoc */ public function getNotLoggedInGroup() { @@ -152,7 +154,7 @@ public function getNotLoggedInGroup() } /** - * {@inheritdoc} + * @inheritdoc */ public function getLoggedInGroups() { @@ -179,7 +181,7 @@ public function getLoggedInGroups() } /** - * {@inheritdoc} + * @inheritdoc */ public function getAllCustomersGroup() { From de61c15eab81fb049556c03dab1814a6cd33bcdb Mon Sep 17 00:00:00 2001 From: roman Date: Wed, 19 Sep 2018 16:09:35 +0300 Subject: [PATCH 59/95] MAGETWO-72048: Wrong file upload behavior --- .../Controller/Adminhtml/Downloadable/File/Upload.php | 4 ++-- .../Controller/Adminhtml/Downloadable/FileTest.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index c593651209047..83b2797050db9 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -5,7 +5,7 @@ */ namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\File; -use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; /** @@ -13,7 +13,7 @@ * * @package Magento\Downloadable\Controller\Adminhtml\Downloadable\File */ -class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpGetActionInterface +class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpPostActionInterface { /** * @var \Magento\Downloadable\Model\Link diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php b/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php index 3f13ce7f41ed6..60c2a41fae49f 100644 --- a/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php +++ b/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php @@ -37,6 +37,7 @@ public function testUploadAction() ], ]; + $this->getRequest()->setMethod('POST'); $this->dispatch('backend/admin/downloadable_file/upload/type/samples'); $body = $this->getResponse()->getBody(); $result = Bootstrap::getObjectManager()->get(Json::class)->unserialize($body); @@ -64,6 +65,7 @@ public function testUploadProhibitedExtensions($fileName) ], ]; + $this->getRequest()->setMethod('POST'); $this->dispatch('backend/admin/downloadable_file/upload/type/samples'); $body = $this->getResponse()->getBody(); $result = Bootstrap::getObjectManager()->get(Json::class)->unserialize($body); From f5e0bda9337e51cd6c0f27dab378638679c0f118 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Wed, 19 Sep 2018 17:28:09 +0300 Subject: [PATCH 60/95] Updated labels section in README.md --- README.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/README.md b/README.md index 6b2ac458eb403..1df8e6cd3d75a 100644 --- a/README.md +++ b/README.md @@ -41,20 +41,7 @@ Magento is thankful for any contribution that can improve our code base, documen

Labels applied by the Magento team

- -| Label | Description | -| ------------- |-------------| -| ![DOC](http://devdocs.magento.com/common/images/github_DOC.png) | Affects Documentation domain. | -| ![PROD](http://devdocs.magento.com/common/images/github_PROD.png) | Affects the Product team (mostly feature requests or business logic change). | -| ![TECH](http://devdocs.magento.com/common/images/github_TECH.png) | Affects Architect Group (mostly to make decisions around technology changes). | -| ![accept](http://devdocs.magento.com/common/images/github_accept.png) | The pull request has been accepted and will be merged into mainline code. | -| ![reject](http://devdocs.magento.com/common/images/github_reject.png) | The pull request has been rejected and will not be merged into mainline code. Possible reasons can include but are not limited to: issue has already been fixed in another code contribution, or there is an issue with the code contribution. | -| ![bug report](http://devdocs.magento.com/common/images/github_bug.png) | The Magento Team has confirmed that this issue contains the minimum required information to reproduce. | -| ![acknowledged](http://devdocs.magento.com/common/images/gitHub_acknowledged.png) | The Magento Team has validated the issue and an internal ticket has been created. | -| ![in progress](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. | -| ![needs update](http://devdocs.magento.com/common/images/github_needsUpdate.png) | The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request. | - -To learn more about issue gate labels click [here](https://github.com/magento/magento2/wiki/Magento-Issue-Gates) +We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more. Find detailed information about labels used in Magento 2 repositories in the corresponded section of the Code Contributions guide.

Reporting security issues

From 062f586694bcdeef58b2589302faecbe7112dd1d Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Wed, 19 Sep 2018 17:37:32 +0300 Subject: [PATCH 61/95] Updated labels section in README.md -- review fixes --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1df8e6cd3d75a..50a20b55d4eb2 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ Magento is thankful for any contribution that can improve our code base, documen

Labels applied by the Magento team

-We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more. Find detailed information about labels used in Magento 2 repositories in the corresponded section of the Code Contributions guide. +We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more. +Please review the Code Contributions guide for detailed information on labels used in Magento 2 repositories.

Reporting security issues

From cfa4d605a2d6437e08d8693135c028e8f7796fbb Mon Sep 17 00:00:00 2001 From: mage2pratik Date: Wed, 19 Sep 2018 23:39:45 +0530 Subject: [PATCH 62/95] Update time12h javascript validation rule to be compatible with js minify --- lib/web/mage/validation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js index 86dd5a3b03681..a577208894944 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -364,7 +364,7 @@ ], 'time12h': [ function (value, element) { - return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$/i.test(value); + return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\s[AP]M))$/i.test(value); }, $.mage.__('Please enter a valid time, between 00:00 am and 12:00 pm') ], From bbf1c0c4ff020e0b2d62667d6bdf4acba77f23f9 Mon Sep 17 00:00:00 2001 From: mage2pratik Date: Thu, 20 Sep 2018 00:25:30 +0530 Subject: [PATCH 63/95] Replace intval() function by using direct type casting to (int) where no default value is needed --- lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php | 8 ++++---- lib/internal/Magento/Framework/DB/Helper.php | 4 ++-- lib/internal/Magento/Framework/DB/Query.php | 2 +- lib/internal/Magento/Framework/DB/Query/BatchIterator.php | 2 +- .../Magento/Framework/DB/Query/BatchRangeIterator.php | 2 +- lib/internal/Magento/Framework/DB/Sql/LimitExpression.php | 4 ++-- .../Framework/Data/Argument/Interpreter/ArrayType.php | 4 ++-- lib/internal/Magento/Framework/Data/Collection.php | 2 +- .../Magento/Framework/Exception/LocalizedException.php | 2 +- lib/internal/Magento/Framework/HTTP/Client/Curl.php | 2 +- lib/internal/Magento/Framework/HTTP/Client/Socket.php | 2 +- lib/internal/Magento/Framework/Image.php | 2 +- .../Mail/Test/Unit/Template/TransportBuilderTest.php | 4 ++-- .../Framework/MessageQueue/Config/CompositeReader.php | 4 ++-- .../MessageQueue/Config/Reader/Xml/CompositeConverter.php | 4 ++-- .../Schema/Db/MySQL/Definition/Columns/Integer.php | 2 +- .../Setup/SchemaListenerDefinition/TextBlobDefinition.php | 8 ++++---- lib/internal/Magento/Framework/System/Ftp.php | 4 ++-- .../Framework/View/Element/UiComponent/Context.php | 4 ++-- lib/internal/Magento/Framework/Webapi/ErrorProcessor.php | 2 +- 20 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index 441da10253a14..6bad0d9643fed 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -3857,13 +3857,13 @@ protected function _parseTextSize($size) switch ($last) { case 'k': - $size = intval($size) * 1024; + $size = (int)$size * 1024; break; case 'm': - $size = intval($size) * 1024 * 1024; + $size = (int)$size * 1024 * 1024; break; case 'g': - $size = intval($size) * 1024 * 1024 * 1024; + $size = (int)$size * 1024 * 1024 * 1024; break; } @@ -3874,7 +3874,7 @@ protected function _parseTextSize($size) return Table::MAX_TEXT_SIZE; } - return intval($size); + return (int)$size; } /** diff --git a/lib/internal/Magento/Framework/DB/Helper.php b/lib/internal/Magento/Framework/DB/Helper.php index 4cb8304cdedf8..dc73af2a466a3 100644 --- a/lib/internal/Magento/Framework/DB/Helper.php +++ b/lib/internal/Magento/Framework/DB/Helper.php @@ -153,12 +153,12 @@ protected function _prepareHaving(\Magento\Framework\DB\Select $select, $autoRes protected function _assembleLimit($query, $limitCount, $limitOffset, $columnList = []) { if ($limitCount !== null) { - $limitCount = intval($limitCount); + $limitCount = (int)$limitCount; if ($limitCount <= 0) { //throw new \Exception("LIMIT argument count={$limitCount} is not valid"); } - $limitOffset = intval($limitOffset); + $limitOffset = (int)$limitOffset; if ($limitOffset < 0) { //throw new \Exception("LIMIT argument offset={$limitOffset} is not valid"); } diff --git a/lib/internal/Magento/Framework/DB/Query.php b/lib/internal/Magento/Framework/DB/Query.php index 04ac2006b5e1f..36aab54df3925 100644 --- a/lib/internal/Magento/Framework/DB/Query.php +++ b/lib/internal/Magento/Framework/DB/Query.php @@ -142,7 +142,7 @@ public function getSize() $sql = $this->getSelectCountSql(); $this->totalRecords = $this->getConnection()->fetchOne($sql, $this->bindParams); } - return intval($this->totalRecords); + return (int)$this->totalRecords; } /** diff --git a/lib/internal/Magento/Framework/DB/Query/BatchIterator.php b/lib/internal/Magento/Framework/DB/Query/BatchIterator.php index 7b4406fd9adb4..2758946998955 100644 --- a/lib/internal/Magento/Framework/DB/Query/BatchIterator.php +++ b/lib/internal/Magento/Framework/DB/Query/BatchIterator.php @@ -165,7 +165,7 @@ private function calculateBatchSize(Select $select) ); $row = $this->connection->fetchRow($wrapperSelect); $this->minValue = $row['max']; - return intval($row['cnt']); + return (int)$row['cnt']; } /** diff --git a/lib/internal/Magento/Framework/DB/Query/BatchRangeIterator.php b/lib/internal/Magento/Framework/DB/Query/BatchRangeIterator.php index 5176c85cfa702..e2ef4ae530a9d 100644 --- a/lib/internal/Magento/Framework/DB/Query/BatchRangeIterator.php +++ b/lib/internal/Magento/Framework/DB/Query/BatchRangeIterator.php @@ -201,7 +201,7 @@ private function initSelectObject() ); $row = $this->connection->fetchRow($wrapperSelect); - $this->totalItemCount = intval($row['cnt']); + $this->totalItemCount = (int)$row['cnt']; } $rangeField = is_array($this->rangeField) ? $this->rangeField : [$this->rangeField]; diff --git a/lib/internal/Magento/Framework/DB/Sql/LimitExpression.php b/lib/internal/Magento/Framework/DB/Sql/LimitExpression.php index 9e875e485c67e..9b3830fcfd142 100644 --- a/lib/internal/Magento/Framework/DB/Sql/LimitExpression.php +++ b/lib/internal/Magento/Framework/DB/Sql/LimitExpression.php @@ -46,14 +46,14 @@ public function __construct( public function __toString() { $sql = $this->sql; - $count = intval($this->count); + $count = (int)$this->count; if ($count <= 0) { /** @see Zend_Db_Adapter_Exception */ #require_once 'Zend/Db/Adapter/Exception.php'; throw new \Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid"); } - $offset = intval($this->offset); + $offset = (int)$this->offset; if ($offset < 0) { /** @see Zend_Db_Adapter_Exception */ #require_once 'Zend/Db/Adapter/Exception.php'; diff --git a/lib/internal/Magento/Framework/Data/Argument/Interpreter/ArrayType.php b/lib/internal/Magento/Framework/Data/Argument/Interpreter/ArrayType.php index b6426a8d26382..9a479591bc710 100644 --- a/lib/internal/Magento/Framework/Data/Argument/Interpreter/ArrayType.php +++ b/lib/internal/Magento/Framework/Data/Argument/Interpreter/ArrayType.php @@ -90,11 +90,11 @@ private function compareItems($firstItemKey, $secondItemKey, $indexedItems) $firstValue = 0; $secondValue = 0; if (isset($firstItem['sortOrder'])) { - $firstValue = intval($firstItem['sortOrder']); + $firstValue = (int)$firstItem['sortOrder']; } if (isset($secondItem['sortOrder'])) { - $secondValue = intval($secondItem['sortOrder']); + $secondValue = (int)$secondItem['sortOrder']; } if ($firstValue == $secondValue) { diff --git a/lib/internal/Magento/Framework/Data/Collection.php b/lib/internal/Magento/Framework/Data/Collection.php index 71ec8c1aa8379..099753ac1b56f 100644 --- a/lib/internal/Magento/Framework/Data/Collection.php +++ b/lib/internal/Magento/Framework/Data/Collection.php @@ -285,7 +285,7 @@ public function getSize() if ($this->_totalRecords === null) { $this->_totalRecords = count($this->getItems()); } - return intval($this->_totalRecords); + return (int)$this->_totalRecords; } /** diff --git a/lib/internal/Magento/Framework/Exception/LocalizedException.php b/lib/internal/Magento/Framework/Exception/LocalizedException.php index 0b1d5f1998bfb..1fe85bc7b3018 100644 --- a/lib/internal/Magento/Framework/Exception/LocalizedException.php +++ b/lib/internal/Magento/Framework/Exception/LocalizedException.php @@ -33,7 +33,7 @@ class LocalizedException extends \Exception public function __construct(Phrase $phrase, \Exception $cause = null, $code = 0) { $this->phrase = $phrase; - parent::__construct($phrase->render(), intval($code), $cause); + parent::__construct($phrase->render(), (int)$code, $cause); } /** diff --git a/lib/internal/Magento/Framework/HTTP/Client/Curl.php b/lib/internal/Magento/Framework/HTTP/Client/Curl.php index 788439aa4ff0d..57a5535751f09 100644 --- a/lib/internal/Magento/Framework/HTTP/Client/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Client/Curl.php @@ -435,7 +435,7 @@ protected function parseHeaders($ch, $data) if (count($line) != 3) { $this->doError("Invalid response line returned from server: " . $data); } - $this->_responseStatus = intval($line[1]); + $this->_responseStatus = (int)$line[1]; } else { $name = $value = ''; $out = explode(": ", trim($data), 2); diff --git a/lib/internal/Magento/Framework/HTTP/Client/Socket.php b/lib/internal/Magento/Framework/HTTP/Client/Socket.php index d229baa5dd476..883a4e0b75964 100644 --- a/lib/internal/Magento/Framework/HTTP/Client/Socket.php +++ b/lib/internal/Magento/Framework/HTTP/Client/Socket.php @@ -424,7 +424,7 @@ protected function processResponse() if (count($line) != 3) { return $this->doError("Invalid response line returned from server: " . $responseLine); } - $this->_responseStatus = intval($line[1]); + $this->_responseStatus = (int)$line[1]; $this->processResponseHeaders(); $this->processRedirect(); diff --git a/lib/internal/Magento/Framework/Image.php b/lib/internal/Magento/Framework/Image.php index 5dc1969559fdd..b3867c0197b79 100644 --- a/lib/internal/Magento/Framework/Image.php +++ b/lib/internal/Magento/Framework/Image.php @@ -262,7 +262,7 @@ public function instruction() public function setImageBackgroundColor($color) { /** @noinspection PhpUndefinedFieldInspection */ - $this->_adapter->imageBackgroundColor = intval($color); + $this->_adapter->imageBackgroundColor = (int)$color; } /** diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php index 731db30bada06..596640480c823 100644 --- a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php @@ -120,12 +120,12 @@ public function testGetTransport($templateType, $messageType, $bodyText, $templa ->with($this->equalTo('Email Subject')) ->willReturnSelf(); - $this->messageMock->expects($this->exactly(intval($messageType == MessageInterface::TYPE_TEXT))) + $this->messageMock->expects($this->exactly((int)($messageType == MessageInterface::TYPE_TEXT))) ->method('setBodyText') ->with($this->equalTo($bodyText)) ->willReturnSelf(); - $this->messageMock->expects($this->exactly(intval($messageType == MessageInterface::TYPE_HTML))) + $this->messageMock->expects($this->exactly((int)($messageType == MessageInterface::TYPE_HTML))) ->method('setBodyHtml') ->with($this->equalTo($bodyText)) ->willReturnSelf(); diff --git a/lib/internal/Magento/Framework/MessageQueue/Config/CompositeReader.php b/lib/internal/Magento/Framework/MessageQueue/Config/CompositeReader.php index 10e0a6f601979..86e83d678c0b0 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Config/CompositeReader.php +++ b/lib/internal/Magento/Framework/MessageQueue/Config/CompositeReader.php @@ -69,10 +69,10 @@ function ($firstItem, $secondItem) { $firstValue = 0; $secondValue = 0; if (isset($firstItem['sortOrder'])) { - $firstValue = intval($firstItem['sortOrder']); + $firstValue = (int)$firstItem['sortOrder']; } if (isset($secondItem['sortOrder'])) { - $secondValue = intval($secondItem['sortOrder']); + $secondValue = (int)$secondItem['sortOrder']; } return $firstValue <=> $secondValue; } diff --git a/lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/CompositeConverter.php b/lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/CompositeConverter.php index b8286c33dca0a..d6f1f89f9e145 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/CompositeConverter.php +++ b/lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/CompositeConverter.php @@ -68,10 +68,10 @@ function ($firstItem, $secondItem) { $firstValue = 0; $secondValue = 0; if (isset($firstItem['sortOrder'])) { - $firstValue = intval($firstItem['sortOrder']); + $firstValue = (int)$firstItem['sortOrder']; } if (isset($secondItem['sortOrder'])) { - $secondValue = intval($secondItem['sortOrder']); + $secondValue = (int)$secondItem['sortOrder']; } return $firstValue <=> $secondValue; } diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Integer.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Integer.php index 07ba03d033106..0df97ebb57592 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Integer.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Integer.php @@ -89,7 +89,7 @@ public function toDefinition(ElementInterface $column) $this->unsigned->toDefinition($column), $this->nullable->toDefinition($column), $column->getDefault() !== null ? - sprintf('DEFAULT %s', (string) intval($column->getDefault())) : '', + sprintf('DEFAULT %s', (string) (int)$column->getDefault()) : '', $this->identity->toDefinition($column), $this->comment->toDefinition($column) ); diff --git a/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/TextBlobDefinition.php b/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/TextBlobDefinition.php index 10e3b70e61be1..336ecaa25e74a 100644 --- a/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/TextBlobDefinition.php +++ b/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/TextBlobDefinition.php @@ -27,13 +27,13 @@ private function parseTextSize($size) switch ($last) { case 'k': - $size = intval($size) * 1024; + $size = (int)$size * 1024; break; case 'm': - $size = intval($size) * 1024 * 1024; + $size = (int)$size * 1024 * 1024; break; case 'g': - $size = intval($size) * 1024 * 1024 * 1024; + $size = (int)$size * 1024 * 1024 * 1024; break; } @@ -44,7 +44,7 @@ private function parseTextSize($size) return Table::MAX_TEXT_SIZE; } - return intval($size); + return (int)$size; } /** diff --git a/lib/internal/Magento/Framework/System/Ftp.php b/lib/internal/Magento/Framework/System/Ftp.php index 8bf898965cbc3..e2a9b2629a72a 100644 --- a/lib/internal/Magento/Framework/System/Ftp.php +++ b/lib/internal/Magento/Framework/System/Ftp.php @@ -127,7 +127,7 @@ public function validateConnectionString($string) public function connect($string, $timeout = 900) { $params = $this->validateConnectionString($string); - $port = isset($params['port']) ? intval($params['port']) : 21; + $port = isset($params['port']) ? (int)$params['port'] : 21; $this->_conn = ftp_connect($params['host'], $port, $timeout); @@ -188,7 +188,7 @@ public function getcwd() if (empty($data[1])) { return false; } - if (intval($data[0]) != 257) { + if ((int)$data[0] != 257) { return false; } $out = trim($data[1], '"'); diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php b/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php index 48a66b429ebd5..6d47d3de12473 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php @@ -297,8 +297,8 @@ public function addButtons(array $buttons, UiComponentInterface $component) */ public function sortButtons(array $itemA, array $itemB) { - $sortOrderA = isset($itemA['sort_order']) ? intval($itemA['sort_order']) : 0; - $sortOrderB = isset($itemB['sort_order']) ? intval($itemB['sort_order']) : 0; + $sortOrderA = isset($itemA['sort_order']) ? (int)$itemA['sort_order'] : 0; + $sortOrderB = isset($itemB['sort_order']) ? (int)$itemB['sort_order'] : 0; return $sortOrderA - $sortOrderB; } diff --git a/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php b/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php index b124c417148d4..6fc5b284b7563 100644 --- a/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php +++ b/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php @@ -317,7 +317,7 @@ public function apiShutdownFunction() protected function _saveFatalErrorReport($reportData) { $this->directoryWrite->create('report/api'); - $reportId = abs(intval(microtime(true) * random_int(100, 1000))); + $reportId = abs((int)(microtime(true) * random_int(100, 1000))); $this->directoryWrite->writeFile('report/api/' . $reportId, $this->serializer->serialize($reportData)); return $reportId; } From d7cfbdb5ee7922e7b6c01bf04eb692ea8134b374 Mon Sep 17 00:00:00 2001 From: vprohorov Date: Thu, 20 Sep 2018 01:59:24 +0300 Subject: [PATCH 64/95] MAGETWO-95105: [2.3] URL Key column with accented characters not converted after importing the CSV file - Adding url formatting to product import --- app/code/Magento/CatalogImportExport/Model/Import/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 9877727a5affb..b755d91e403ff 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -2839,7 +2839,7 @@ protected function getProductUrlSuffix($storeId = null) protected function getUrlKey($rowData) { if (!empty($rowData[self::URL_KEY])) { - return strtolower($rowData[self::URL_KEY]); + return $this->productUrl->formatUrlKey($rowData[self::URL_KEY]); } if (!empty($rowData[self::COL_NAME])) { From ad35b6f83dadcf3e33e7d6a09ca8125d189cfa87 Mon Sep 17 00:00:00 2001 From: David Manners Date: Thu, 20 Sep 2018 10:39:14 +0000 Subject: [PATCH 65/95] Update Magento_Sales integrations tests to fix error when running RMA module tests - Use the order repository for saving, - Use guest customer, - Attach email address to order, --- .../testsuite/Magento/Sales/_files/order_list.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php index 2789c8040f353..9a7442081770f 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php @@ -5,6 +5,7 @@ */ use Magento\Sales\Model\Order; +use Magento\Sales\Api\OrderRepositoryInterface; require 'order.php'; /** @var Order $order */ @@ -47,6 +48,8 @@ ], ]; +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->create(OrderRepositoryInterface::class); /** @var array $orderData */ foreach ($orders as $orderData) { /** @var $order \Magento\Sales\Model\Order */ @@ -60,13 +63,16 @@ $billingAddress->setAddressType('billing'); /** @var Order\Address $shippingAddress */ - $shippingAddress = clone $billingAddress; - $shippingAddress->setId(null)->setAddressType('shipping'); + $shippingAddress = $objectManager->create(\Magento\Sales\Model\Order\Address::class, ['data' => $addressData]); + $shippingAddress->setAddressType('shipping'); $order ->setData($orderData) ->addItem($orderItem) ->setBillingAddress($billingAddress) ->setShippingAddress($shippingAddress) - ->save(); + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com'); + + $orderRepository->save($order); } From 214ba6748a99d211578471ad8c158375ca4951b9 Mon Sep 17 00:00:00 2001 From: David Manners Date: Thu, 20 Sep 2018 12:09:02 +0000 Subject: [PATCH 66/95] Set the customer address and is gust flag before setting the addresses against the order --- .../testsuite/Magento/Sales/_files/order_list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php index 9a7442081770f..7f14d8cf26056 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php @@ -6,6 +6,7 @@ use Magento\Sales\Model\Order; use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Model\Order\Address as OrderAddress; require 'order.php'; /** @var Order $order */ @@ -59,20 +60,19 @@ // Reset addresses /** @var Order\Address $billingAddress */ - $billingAddress = $objectManager->create(\Magento\Sales\Model\Order\Address::class, ['data' => $addressData]); + $billingAddress = $objectManager->create(OrderAddress::class, ['data' => $addressData]); $billingAddress->setAddressType('billing'); - /** @var Order\Address $shippingAddress */ - $shippingAddress = $objectManager->create(\Magento\Sales\Model\Order\Address::class, ['data' => $addressData]); - $shippingAddress->setAddressType('shipping'); + $shippingAddress = clone $billingAddress; + $shippingAddress->setId(null)->setAddressType('shipping'); $order ->setData($orderData) ->addItem($orderItem) - ->setBillingAddress($billingAddress) - ->setShippingAddress($shippingAddress) ->setCustomerIsGuest(true) - ->setCustomerEmail('customer@null.com'); + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress); $orderRepository->save($order); } From b6e2a7779032257f3b566867fad6c0e896488723 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Thu, 20 Sep 2018 15:59:16 +0300 Subject: [PATCH 67/95] magento-engcom/magento2ce#2193: Fixed static test failures --- .../Block/Widget/Button/ButtonList.php | 2 + .../Model/Config/Structure/Mapper/Sorting.php | 4 ++ .../Model/DeploymentConfig/ImporterPool.php | 2 + .../Adminhtml/Order/View/Tab/History.php | 9 +++-- .../Sales/Model/Order/Pdf/AbstractPdf.php | 7 ++-- .../Rest/Asynchronous/InputParamsResolver.php | 5 ++- .../Framework/DB/Adapter/Pdo/Mysql.php | 37 ++++++++++++++++--- lib/internal/Magento/Framework/DB/Helper.php | 6 ++- .../Framework/DB/Query/BatchIterator.php | 10 +++++ .../Framework/DB/Sql/LimitExpression.php | 2 +- .../Data/Argument/Interpreter/ArrayType.php | 2 +- .../Magento/Framework/Data/Collection.php | 23 +++++++----- .../Exception/LocalizedException.php | 2 + .../Magento/Framework/HTTP/Client/Curl.php | 8 ++++ .../Magento/Framework/HTTP/Client/Socket.php | 14 ++++--- .../Config/Reader/Xml/CompositeConverter.php | 2 +- .../Db/MySQL/Definition/Columns/Integer.php | 2 +- .../TextBlobDefinition.php | 1 + lib/internal/Magento/Framework/System/Ftp.php | 22 +++++------ .../View/Element/UiComponent/Context.php | 36 +++++++++--------- 20 files changed, 132 insertions(+), 64 deletions(-) diff --git a/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php b/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php index e2d71d171cf15..5a792ddb39132 100644 --- a/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php +++ b/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php @@ -7,6 +7,8 @@ namespace Magento\Backend\Block\Widget\Button; /** + * Button list widget + * * @api * @since 100.0.2 */ diff --git a/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php b/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php index e615678550108..19e1acc6170f9 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php +++ b/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php @@ -10,6 +10,8 @@ namespace Magento\Config\Model\Config\Structure\Mapper; /** + * Sorting mapper + * * @api * @since 100.0.2 */ @@ -30,6 +32,8 @@ public function map(array $data) } /** + * Process config + * * @param array $data * @return array */ diff --git a/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php b/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php index cae76a4c2591f..efcc12e089491 100644 --- a/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php +++ b/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php @@ -110,6 +110,8 @@ public function __construct( } /** + * Retrieves sections names + * * Retrieves names of sections for configuration files whose data is read from these files for import * to appropriate application sources. * diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php index 30b0872dfa90d..0972d74314246 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php @@ -61,6 +61,7 @@ public function getOrder() /** * Compose and get order full history. + * * Consists of the status history comments as well as of invoices, shipments and creditmemos creations * * @TODO This method requires refactoring. Need to create separate model for comment history handling @@ -218,7 +219,7 @@ protected function _prepareHistoryItem($label, $notified, $created, $comment = ' } /** - * {@inheritdoc} + * @inheritdoc */ public function getTabLabel() { @@ -226,7 +227,7 @@ public function getTabLabel() } /** - * {@inheritdoc} + * @inheritdoc */ public function getTabTitle() { @@ -264,7 +265,7 @@ public function getTabUrl() } /** - * {@inheritdoc} + * @inheritdoc */ public function canShowTab() { @@ -272,7 +273,7 @@ public function canShowTab() } /** - * {@inheritdoc} + * @inheritdoc */ public function isHidden() { diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index 2989e8a95c198..85e34f560bb7b 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -158,8 +158,7 @@ public function __construct( } /** - * Returns the total width in points of the string using the specified font and - * size. + * Returns the total width in points of the string using the specified font and size. * * This is not the most efficient way to perform this calculation. I'm * concentrating optimization efforts on the upcoming layout manager class. @@ -230,7 +229,7 @@ public function getAlignCenter($string, $x, $columnWidth, \Zend_Pdf_Resource_Fon * Insert logo to pdf page * * @param \Zend_Pdf_Page &$page - * @param null $store + * @param string|null $store * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ @@ -285,7 +284,7 @@ protected function insertLogo(&$page, $store = null) * Insert address to pdf page * * @param \Zend_Pdf_Page &$page - * @param null $store + * @param string|null $store * @return void */ protected function insertAddress(&$page, $store = null) diff --git a/app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php b/app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php index 4ebb23f33e97b..e74db459808ce 100644 --- a/app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php +++ b/app/code/Magento/WebapiAsync/Controller/Rest/Asynchronous/InputParamsResolver.php @@ -110,6 +110,8 @@ public function resolve() } /** + * Returns route. + * * @return \Magento\Webapi\Controller\Rest\Router\Route */ public function getRoute() @@ -118,8 +120,7 @@ public function getRoute() } /** - * Convert the input array from key-value format to a list of parameters - * suitable for the specified class / method. + * Convert the input array from key-value format to a list of parameters suitable for the specified class / method. * * Instead of \Magento\Webapi\Controller\Rest\InputParamsResolver * we don't need to merge body params with url params and use only body params diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index 6bad0d9643fed..86266ec23fe47 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -515,6 +515,7 @@ protected function _checkDdlTransaction($sql) /** * Special handling for PDO query(). + * * All bind parameter names must begin with ':'. * * @param string|\Magento\Framework\DB\Select $sql The SQL statement with placeholders. @@ -595,6 +596,7 @@ protected function _query($sql, $bind = []) /** * Special handling for PDO query(). + * * All bind parameter names must begin with ':'. * * @param string|\Magento\Framework\DB\Select $sql The SQL statement with placeholders. @@ -615,9 +617,10 @@ public function query($sql, $bind = []) } /** + * Allows multiple queries + * * Allows multiple queries -- to safeguard against SQL injection, USE CAUTION and verify that input * cannot be tampered with. - * * Special handling for PDO query(). * All bind parameter names must begin with ':'. * @@ -1278,6 +1281,7 @@ public function getForeignKeysTree() /** * Modify tables, used for upgrade process + * * Change columns definitions, reset foreign keys, change tables comments and engines. * * The value of each array element is an associative array @@ -1469,9 +1473,9 @@ public function select() * * Method revrited for handle empty arrays in value param * - * @param string $text The text with a placeholder. - * @param mixed $value The value to quote. - * @param string $type OPTIONAL SQL datatype + * @param string $text The text with a placeholder. + * @param mixed $value The value to quote. + * @param string $type OPTIONAL SQL datatype * @param integer $count OPTIONAL count of placeholders to replace * @return string An SQL-safe quoted value placed into the orignal text. */ @@ -1514,6 +1518,7 @@ protected function _getCacheId($tableKey, $ddlType) /** * Load DDL data from cache + * * Return false if cache does not exists * * @param string $tableCacheKey the table cache key @@ -1568,7 +1573,8 @@ public function saveDdlCache($tableCacheKey, $ddlType, $data) /** * Reset cached DDL data from cache - * if table name is null - reset all cached DDL data + * + * If table name is null - reset all cached DDL data * * @param string $tableName * @param string $schemaName OPTIONAL @@ -1605,6 +1611,7 @@ public function resetDdlCache($tableName = null, $schemaName = null) /** * Disallow DDL caching + * * @return $this */ public function disallowDdlCache() @@ -1615,6 +1622,7 @@ public function disallowDdlCache() /** * Allow DDL caching + * * @return $this */ public function allowDdlCache() @@ -1675,9 +1683,10 @@ public function describeTable($tableName, $schemaName = null) /** * Format described column to definition, ready to be added to ddl table. + * * Return array with keys: name, type, length, options, comment * - * @param array $columnData + * @param array $columnData * @return array * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -1892,6 +1901,7 @@ public function changeTableComment($tableName, $comment, $schemaName = null) /** * Inserts a table row with specified data + * * Special for Zero values to identity column * * @param string $table @@ -2782,6 +2792,7 @@ public function dropIndex($tableName, $keyName, $schemaName = null) /** * Add new Foreign Key to table + * * If Foreign Key with same name is exist - it will be deleted * * @param string $fkName @@ -3016,6 +3027,7 @@ protected function _transformStringSqlCondition($conditionKey, $value) /** * Prepare value for save in column + * * Return converted to column data type value * * @param array $column the column describe array @@ -3139,6 +3151,8 @@ public function getIfNullSql($expression, $value = 0) } /** + * Generates case SQL fragment + * * Generate fragment of SQL, that check value against multiple condition cases * and return different result depends on them * @@ -3163,6 +3177,7 @@ public function getCaseSql($valueName, $casesResults, $defaultValue = null) /** * Generate fragment of SQL, that combine together (concatenate) the results from data array + * * All arguments in data must be quoted * * @param string[] $data @@ -3177,6 +3192,7 @@ public function getConcatSql(array $data, $separator = null) /** * Generate fragment of SQL that returns length of character string + * * The string argument must be quoted * * @param string $string @@ -3188,6 +3204,8 @@ public function getLengthSql($string) } /** + * Generate least SQL fragment + * * Generate fragment of SQL, that compare with two or more arguments, and returns the smallest * (minimum-valued) argument * All arguments in data must be quoted @@ -3201,6 +3219,8 @@ public function getLeastSql(array $data) } /** + * Generate greatest SQL fragment + * * Generate fragment of SQL, that compare with two or more arguments, and returns the largest * (maximum-valued) argument * All arguments in data must be quoted @@ -3371,6 +3391,7 @@ public function getTriggerName($tableName, $time, $event) /** * Retrieve valid index name + * * Check index name length and allowed symbols * * @param string $tableName @@ -3400,6 +3421,7 @@ public function getIndexName($tableName, $fields, $indexType = '') /** * Retrieve valid foreign key name + * * Check foreign key name length and allowed symbols * * @param string $priTableName @@ -3668,6 +3690,7 @@ public function supportStraightJoin() /** * Adds order by random to select object + * * Possible using integer field for optimization * * @param Select $select @@ -3845,6 +3868,7 @@ public function getPrimaryKeyName($tableName, $schemaName = null) /** * Parse text size + * * Returns max allowed size if value great it * * @param string|int $size @@ -3879,6 +3903,7 @@ protected function _parseTextSize($size) /** * Converts fetched blob into raw binary PHP data. + * * The MySQL drivers do it nice, no processing required. * * @param mixed $value diff --git a/lib/internal/Magento/Framework/DB/Helper.php b/lib/internal/Magento/Framework/DB/Helper.php index dc73af2a466a3..4d4eac62978ca 100644 --- a/lib/internal/Magento/Framework/DB/Helper.php +++ b/lib/internal/Magento/Framework/DB/Helper.php @@ -8,6 +8,9 @@ namespace Magento\Framework\DB; +/** + * DataBase Helper + */ class Helper extends \Magento\Framework\DB\Helper\AbstractHelper { /** @@ -52,7 +55,7 @@ protected function _prepareOrder(\Magento\Framework\DB\Select $select, $autoRese * Field can be with 'dot' delimiter. * * @param string $field - * @param bool $reverse OPTIONAL + * @param bool $reverse OPTIONAL * @return string */ protected function _truncateAliasName($field, $reverse = false) @@ -143,6 +146,7 @@ protected function _prepareHaving(\Magento\Framework\DB\Select $select, $autoRes } /** + * Assemble limit * * @param string $query * @param int $limitCount diff --git a/lib/internal/Magento/Framework/DB/Query/BatchIterator.php b/lib/internal/Magento/Framework/DB/Query/BatchIterator.php index 2758946998955..6485973ec359d 100644 --- a/lib/internal/Magento/Framework/DB/Query/BatchIterator.php +++ b/lib/internal/Magento/Framework/DB/Query/BatchIterator.php @@ -88,6 +88,8 @@ public function __construct( } /** + * Returns current select + * * @return Select */ public function current() @@ -101,6 +103,8 @@ public function current() } /** + * Returns next select + * * @return Select */ public function next() @@ -121,6 +125,8 @@ public function next() } /** + * Returns key + * * @return int */ public function key() @@ -129,6 +135,8 @@ public function key() } /** + * Returns is valid + * * @return bool */ public function valid() @@ -137,6 +145,8 @@ public function valid() } /** + * Rewind + * * @return void */ public function rewind() diff --git a/lib/internal/Magento/Framework/DB/Sql/LimitExpression.php b/lib/internal/Magento/Framework/DB/Sql/LimitExpression.php index 9b3830fcfd142..3c5cb65e898f3 100644 --- a/lib/internal/Magento/Framework/DB/Sql/LimitExpression.php +++ b/lib/internal/Magento/Framework/DB/Sql/LimitExpression.php @@ -41,7 +41,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function __toString() { diff --git a/lib/internal/Magento/Framework/Data/Argument/Interpreter/ArrayType.php b/lib/internal/Magento/Framework/Data/Argument/Interpreter/ArrayType.php index 9a479591bc710..9a881ccf515ab 100644 --- a/lib/internal/Magento/Framework/Data/Argument/Interpreter/ArrayType.php +++ b/lib/internal/Magento/Framework/Data/Argument/Interpreter/ArrayType.php @@ -28,7 +28,7 @@ public function __construct(InterpreterInterface $itemInterpreter) } /** - * {@inheritdoc} + * @inheritdoc * @return array * @throws \InvalidArgumentException */ diff --git a/lib/internal/Magento/Framework/Data/Collection.php b/lib/internal/Magento/Framework/Data/Collection.php index 099753ac1b56f..9c789e81913c4 100644 --- a/lib/internal/Magento/Framework/Data/Collection.php +++ b/lib/internal/Magento/Framework/Data/Collection.php @@ -487,8 +487,7 @@ public function clear() } /** - * Walk through the collection and run model method or external callback - * with optional arguments + * Walk through the collection and run model method or external callback with optional arguments * * Returns array with results of callback for each item * @@ -743,7 +742,7 @@ public function toArray($arrRequiredFields = []) /** * Convert items array to array for select options * - * return items array + * Return items array * array( * $index => array( * 'value' => mixed @@ -772,6 +771,8 @@ protected function _toOptionArray($valueField = 'id', $labelField = 'name', $add } /** + * Returns option array + * * @return array */ public function toOptionArray() @@ -780,6 +781,8 @@ public function toOptionArray() } /** + * Returns options hash + * * @return array */ public function toOptionHash() @@ -790,12 +793,12 @@ public function toOptionHash() /** * Convert items array to hash for select options * - * return items hash + * Return items hash * array($value => $label) * - * @param string $valueField - * @param string $labelField - * @return array + * @param string $valueField + * @param string $labelField + * @return array */ protected function _toOptionHash($valueField = 'id', $labelField = 'name') { @@ -809,8 +812,8 @@ protected function _toOptionHash($valueField = 'id', $labelField = 'name') /** * Retrieve item by id * - * @param mixed $idValue - * @return \Magento\Framework\DataObject + * @param mixed $idValue + * @return \Magento\Framework\DataObject */ public function getItemById($idValue) { @@ -879,6 +882,8 @@ public function hasFlag($flag) } /** + * Sleep handler + * * @return string[] * @since 100.0.11 */ diff --git a/lib/internal/Magento/Framework/Exception/LocalizedException.php b/lib/internal/Magento/Framework/Exception/LocalizedException.php index 1fe85bc7b3018..977c69db77bbc 100644 --- a/lib/internal/Magento/Framework/Exception/LocalizedException.php +++ b/lib/internal/Magento/Framework/Exception/LocalizedException.php @@ -11,6 +11,8 @@ use Magento\Framework\Phrase\Renderer\Placeholder; /** + * Localized exception + * * @api */ class LocalizedException extends \Exception diff --git a/lib/internal/Magento/Framework/HTTP/Client/Curl.php b/lib/internal/Magento/Framework/HTTP/Client/Curl.php index 57a5535751f09..d1dfafdeb2adb 100644 --- a/lib/internal/Magento/Framework/HTTP/Client/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Client/Curl.php @@ -161,6 +161,7 @@ public function removeHeader($name) /** * Authorization: Basic header + * * Login credentials support * * @param string $login username @@ -209,6 +210,7 @@ public function setCookies($cookies) /** * Clear cookies + * * @return void */ public function removeCookies() @@ -293,6 +295,7 @@ public function getCookies() /** * Get cookies array with details * (domain, expire time etc) + * * @return array */ public function getCookiesFull() @@ -327,6 +330,7 @@ public function getCookiesFull() /** * Get response status code + * * @see lib\Magento\Framework\HTTP\Client#getStatus() * * @return int @@ -345,6 +349,7 @@ public function getStatus() * @param string $method * @param string $uri * @param array|string $params - use $params as a string in case of JSON or XML POST request. + * * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -410,6 +415,7 @@ protected function makeRequest($method, $uri, $params = []) /** * Throw error exception + * * @param string $string * @return void * @throws \Exception @@ -474,6 +480,7 @@ protected function curlOption($name, $value) /** * Set curl options array directly + * * @param array $arr * @return void */ @@ -484,6 +491,7 @@ protected function curlOptions($arr) /** * Set CURL options overrides array + * * @param array $arr * @return void */ diff --git a/lib/internal/Magento/Framework/HTTP/Client/Socket.php b/lib/internal/Magento/Framework/HTTP/Client/Socket.php index 883a4e0b75964..eba182b98b93e 100644 --- a/lib/internal/Magento/Framework/HTTP/Client/Socket.php +++ b/lib/internal/Magento/Framework/HTTP/Client/Socket.php @@ -12,9 +12,8 @@ namespace Magento\Framework\HTTP\Client; /** - * @SuppressWarnings(PHPMD.UnusedPrivateField) - */ -/** + * Socket client + * * @SuppressWarnings(PHPMD.UnusedPrivateField) */ class Socket implements \Magento\Framework\HTTP\ClientInterface @@ -134,6 +133,7 @@ public function disconnect() /** * Set headers from hash + * * @param array $headers * @return void */ @@ -167,6 +167,7 @@ public function removeHeader($name) /** * Authorization: Basic header + * * Login credentials support * * @param string $login username @@ -235,8 +236,7 @@ public function get($uri) } /** - * Set host, port from full url - * and return relative url + * Set host, port from full url and return relative url * * @param string $uri ex. http://google.com/index.php?a=b * @return string ex. /index.php?a=b @@ -330,6 +330,7 @@ public function getCookies() /** * Get cookies array with details * (domain, expire time etc) + * * @return array */ public function getCookiesFull() @@ -444,6 +445,7 @@ protected function processRedirect() /** * Get response status code + * * @see \Magento\Framework\HTTP\Client#getStatus() * * @return int @@ -494,6 +496,7 @@ protected function makeRequest($method, $uri, $params = []) /** * Throw error exception + * * @param string $string * @return void * @throws \Exception @@ -505,6 +508,7 @@ public function doError($string) /** * Convert headers hash to string + * * @param array $append * @return string */ diff --git a/lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/CompositeConverter.php b/lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/CompositeConverter.php index d6f1f89f9e145..0184f720b3b4e 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/CompositeConverter.php +++ b/lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/CompositeConverter.php @@ -43,7 +43,7 @@ public function __construct(array $converters) } /** - * {@inheritdoc} + * @inheritdoc */ public function convert($source) { diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Integer.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Integer.php index 0df97ebb57592..1d08c5bea4eb0 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Integer.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns/Integer.php @@ -76,8 +76,8 @@ public function __construct( } /** - * @param \Magento\Framework\Setup\Declaration\Schema\Dto\Columns\Integer $column * @inheritdoc + * @param \Magento\Framework\Setup\Declaration\Schema\Dto\Columns\Integer $column */ public function toDefinition(ElementInterface $column) { diff --git a/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/TextBlobDefinition.php b/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/TextBlobDefinition.php index 336ecaa25e74a..9e8d63b26cfca 100644 --- a/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/TextBlobDefinition.php +++ b/lib/internal/Magento/Framework/Setup/SchemaListenerDefinition/TextBlobDefinition.php @@ -15,6 +15,7 @@ class TextBlobDefinition implements DefinitionConverterInterface { /** * Parse text size. + * * Returns max allowed size if value great it. * * @param string|int $size diff --git a/lib/internal/Magento/Framework/System/Ftp.php b/lib/internal/Magento/Framework/System/Ftp.php index e2a9b2629a72a..ad0673ff5d7d3 100644 --- a/lib/internal/Magento/Framework/System/Ftp.php +++ b/lib/internal/Magento/Framework/System/Ftp.php @@ -32,7 +32,7 @@ protected function checkConnected() } /** - * ftp_mkdir wrapper + * Wrapper for ftp_mkdir * * @param string $name * @return string the newly created directory name on success or FALSE on error. @@ -147,7 +147,7 @@ public function connect($string, $timeout = 900) } /** - * ftp_fput wrapper + * Wrapper for ftp_fput * * @param string $remoteFile * @param resource $handle @@ -162,7 +162,7 @@ public function fput($remoteFile, $handle, $mode = FTP_BINARY, $startPos = 0) } /** - * ftp_put wrapper + * Wrapper for ftp_put * * @param string $remoteFile * @param string $localFile @@ -199,7 +199,7 @@ public function getcwd() } /** - * ftp_raw wrapper + * Wrapper for ftp_raw * * @param string $cmd * @return array The server's response as an array of strings. @@ -272,7 +272,7 @@ public function download($remote, $local, $ftpMode = FTP_BINARY) } /** - * ftp_pasv wrapper + * Wrapper for ftp_pasv * * @param bool $pasv * @return bool @@ -296,7 +296,7 @@ public function close() } /** - * ftp_chmod wrapper + * Wrapper for ftp_chmod * * @param int $mode * @param string $remoteFile @@ -309,7 +309,7 @@ public function chmod($mode, $remoteFile) } /** - * ftp_chdir wrapper + * Wrapper for ftp_chdir * * @param string $dir * @return bool @@ -321,7 +321,7 @@ public function chdir($dir) } /** - * ftp_cdup wrapper + * Wrapper for ftp_cdup * * @return bool */ @@ -332,7 +332,7 @@ public function cdup() } /** - * ftp_get wrapper + * Wrapper for ftp_get * * @param string $localFile * @param string $remoteFile @@ -349,7 +349,7 @@ public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffs } /** - * ftp_nlist wrapper + * Wrapper for ftp_nlist * * @param string $dir * @return bool @@ -362,7 +362,7 @@ public function nlist($dir = "/") } /** - * ftp_rawlist wrapper + * Wrapper for ftp_rawlist * * @param string $dir * @param bool $recursive diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php b/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php index 6d47d3de12473..e472a9c9effb1 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php @@ -104,7 +104,7 @@ class Context implements ContextInterface * @param Processor $processor * @param UiComponentFactory $uiComponentFactory * @param DataProviderInterface|null $dataProvider - * @param null $namespace + * @param string|null $namespace * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -152,7 +152,7 @@ public function addComponentDefinition($name, array $config) } /** - * {@inheritdoc} + * @inheritdoc */ public function getComponentsDefinitions() { @@ -160,7 +160,7 @@ public function getComponentsDefinitions() } /** - * {@inheritdoc} + * @inheritdoc */ public function getRenderEngine() { @@ -168,7 +168,7 @@ public function getRenderEngine() } /** - * {@inheritdoc} + * @inheritdoc */ public function getNamespace() { @@ -176,7 +176,7 @@ public function getNamespace() } /** - * {@inheritdoc} + * @inheritdoc */ public function getAcceptType() { @@ -184,7 +184,7 @@ public function getAcceptType() } /** - * {@inheritdoc} + * @inheritdoc */ public function getRequestParams() { @@ -192,7 +192,7 @@ public function getRequestParams() } /** - * {@inheritdoc} + * @inheritdoc */ public function getRequestParam($key, $defaultValue = null) { @@ -200,7 +200,7 @@ public function getRequestParam($key, $defaultValue = null) } /** - * {@inheritdoc} + * @inheritdoc */ public function getFiltersParams() { @@ -208,7 +208,7 @@ public function getFiltersParams() } /** - * {@inheritdoc} + * @inheritdoc */ public function getFilterParam($key, $defaultValue = null) { @@ -217,7 +217,7 @@ public function getFilterParam($key, $defaultValue = null) } /** - * {@inheritdoc} + * @inheritdoc */ public function getDataProvider() { @@ -225,7 +225,7 @@ public function getDataProvider() } /** - * {@inheritdoc} + * @inheritdoc */ public function getDataSourceData(UiComponentInterface $component) { @@ -250,7 +250,7 @@ public function getDataSourceData(UiComponentInterface $component) } /** - * {@inheritdoc} + * @inheritdoc */ public function getPageLayout() { @@ -258,7 +258,7 @@ public function getPageLayout() } /** - * {@inheritdoc} + * @inheritdoc */ public function addButtons(array $buttons, UiComponentInterface $component) { @@ -304,7 +304,7 @@ public function sortButtons(array $itemA, array $itemB) } /** - * {@inheritdoc} + * @inheritdoc * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ public function addHtmlBlocks(array $htmlBlocks, UiComponentInterface $component) @@ -336,7 +336,7 @@ protected function setAcceptType() } /** - * {@inheritdoc} + * @inheritdoc */ public function setDataProvider(DataProviderInterface $dataProvider) { @@ -344,7 +344,7 @@ public function setDataProvider(DataProviderInterface $dataProvider) } /** - * {@inheritdoc} + * @inheritdoc */ public function getUrl($route = '', $params = []) { @@ -370,7 +370,7 @@ protected function prepareDataSource(array & $data, UiComponentInterface $compon } /** - * {@inheritdoc} + * @inheritdoc */ public function getProcessor() { @@ -378,7 +378,7 @@ public function getProcessor() } /** - * {@inheritdoc} + * @inheritdoc */ public function getUiComponentFactory() { From e19cf1539088382227e82182591a05637a2e62d4 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Thu, 20 Sep 2018 09:28:30 -0500 Subject: [PATCH 68/95] MQE-1263: Deliver flaky fixes and unskipped tests --- .../Mftf/Test/AdminCreateAndDeleteBackupsTest.xml | 5 ++++- .../Test/Mftf/Section/AdminProductFormSection.xml | 2 +- ...assignProductAttributeFromAttributeSetTest.xml | 15 ++++----------- .../Test/StorefrontProductNameWithDoubleQuote.xml | 4 ---- ...roductWithCustomOptionsWithLongValuesTitle.xml | 7 +------ ...YSIWYGWithRecentlyComparedProductsTypeTest.xml | 2 -- .../Mftf/Section/AdminInvoicesFiltersSection.xml | 1 + .../Test/Mftf/Test/AdminCreateInvoiceTest.xml | 2 ++ .../Test/Mftf/ActionGroup/AdminTaxActionGroup.xml | 12 ++++++++++++ ...ionInShoppingCartForGuestPhysicalQuoteTest.xml | 5 +++-- ...tionInShoppingCartForGuestVirtualQuoteTest.xml | 5 +++-- ...rontAddMultipleStoreProductsToWishlistTest.xml | 5 +++-- .../StorefrontDeletePersistedWishlistTest.xml | 4 ++-- 13 files changed, 36 insertions(+), 33 deletions(-) diff --git a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml index b83434f7ad1de..496bb79343092 100644 --- a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml +++ b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml @@ -17,7 +17,10 @@ - + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml index 545b685f4d21f..a138c9bbac073 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml @@ -117,7 +117,7 @@ - + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml index dc6cf012840eb..a33c7bb12879a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml @@ -17,33 +17,25 @@ - - - - - - - - @@ -64,6 +56,8 @@ + + @@ -72,8 +66,7 @@ - - - + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml index 569eb290bae3c..386633f0e9476 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml @@ -17,10 +17,6 @@ - - - - diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml index 9d7c616238451..a03636e52ee97 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml @@ -17,11 +17,6 @@ - - - - - @@ -106,6 +101,6 @@ - + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index c89aa27c10e77..691a99a73b90b 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -17,8 +17,6 @@ - - diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesFiltersSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesFiltersSection.xml index 8fb45295bd26e..78b9c853ff6a2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesFiltersSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesFiltersSection.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml index 05f20371851bc..82f5b515eb967 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml @@ -78,8 +78,10 @@ + + diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml index d6e5f4b693c19..1a95bf0282b40 100644 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml @@ -16,14 +16,18 @@ + + + + @@ -33,7 +37,9 @@ + + @@ -54,13 +60,17 @@ + + + + @@ -69,7 +79,9 @@ + + diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml index 47161001219e8..9bc44dec0b5b8 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml @@ -16,10 +16,11 @@ - - + + + diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml index 88496b8e2cd27..a0eac56e4db09 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml @@ -16,10 +16,11 @@ - - + + + diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index 145fb94f356f7..c9a0c0cc0f8bc 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -13,10 +13,11 @@ <description value="All products added to wishlist should be visible on any store. Even if product visibility was set to 'Not Visible Individually' for this store"/> - <!-- Skipped because of MAGETWO-93980 --> - <group value="skip"/> <group value="wishlist"/> <severity value="AVERAGE"/> + <skip> + <issueId value="MAGETWO-93980"/> + </skip> </annotations> <before> <createData entity="customStoreGroup" stepKey="storeGroup"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeletePersistedWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeletePersistedWishlistTest.xml index 0ae2b6af804bd..0001bd9d6db75 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeletePersistedWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeletePersistedWishlistTest.xml @@ -13,12 +13,12 @@ <stories value="Delete a persist wishlist for a customer"/> <title value="Customer should be able to delete a persistent wishlist"/> <description value="Customer should be able to delete a persistent wishlist"/> + <severity value="AVERAGE"/> <group value="wishlist"/> - <group value="skip"/> + <testCaseId value="MC-4110"/> <skip> <issueId value="MQE-1145"/> </skip> - <severity value="AVERAGE"/> </annotations> <before> <createData stepKey="category" entity="SimpleSubCategory"/> From dad6575d93496bae88bdb37b1fe4c529b823c7d3 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda <vnayda@magento.com> Date: Thu, 20 Sep 2018 17:30:11 +0300 Subject: [PATCH 69/95] GraphQL-88: 'small_image' in 'ProductInterface' does not have enough info -- Update benchmarks scenarios according to updated GraphQL Schema --- setup/performance-toolkit/benchmark.jmx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index 3b74af8a111d6..8b295c9f5fc46 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -40763,7 +40763,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(\n filter: {\n price: {gt: \"10\"}\n or: {\n sku:{like:\"%Product%\"}\n name:{like:\"%Configurable Product%\"}\n }\n }\n pageSize: 200\n currentPage: 1\n sort: {\n price: ASC\n name:DESC\n }\n ) {\n total_count\n items {\n attribute_set_id\n country_of_manufacture\n created_at\n description\n gift_message_available\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n \t... on PhysicalProductInterface {\n \tweight\n \t}\n }\n page_info {\n page_size\n current_page\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(\n filter: {\n price: {gt: \"10\"}\n or: {\n sku:{like:\"%Product%\"}\n name:{like:\"%Configurable Product%\"}\n }\n }\n pageSize: 200\n currentPage: 1\n sort: {\n price: ASC\n name:DESC\n }\n ) {\n total_count\n items {\n attribute_set_id\n country_of_manufacture\n created_at\n description\n gift_message_available\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n \t... on PhysicalProductInterface {\n \tweight\n \t}\n }\n page_info {\n page_size\n current_page\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -40820,7 +40820,7 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${simple_product_sku}\" } })\n {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${simple_product_sku}\" } })\n {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -40896,7 +40896,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: {eq:\"${configurable_product_sku}\"} }) {\n total_count\n items {\n ... on PhysicalProductInterface {\n weight\n }\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: {eq:\"${configurable_product_sku}\"} }) {\n total_count\n items {\n ... on PhysicalProductInterface {\n weight\n }\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -40965,7 +40965,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(\n search: \"configurable\"\n filter: {price: {gteq: \"1\"} }\n ) {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(\n search: \"configurable\"\n filter: {price: {gteq: \"1\"} }\n ) {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -41025,7 +41025,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(search: \"configurable\") {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(search: \"configurable\") {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -41085,7 +41085,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(search: \"color\") {\n filters {\n name\n filter_items_count\n request_var\n filter_items {\n label\n value_string\n items_count\n ... on SwatchLayerFilterItemInterface {\n swatch_data {\n type\n value\n }\n }\n }\n }\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n weight\n }\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(search: \"color\") {\n filters {\n name\n filter_items_count\n request_var\n filter_items {\n label\n value_string\n items_count\n ... on SwatchLayerFilterItemInterface {\n swatch_data {\n type\n value\n }\n }\n }\n }\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n weight\n }\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -41145,7 +41145,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\nproducts(filter: {sku: {eq:\"${bundle_product_sku}\"} }) {\n total_count\n items {\n ... on PhysicalProductInterface {\n weight\n }\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on BundleProduct {\n weight\n price_view\n dynamic_price\n dynamic_sku\n ship_bundle_items\n dynamic_weight\n items {\n option_id\n title\n required\n type\n position\n sku\n options {\n id\n qty\n position\n is_default\n price\n price_type\n can_change_quantity\n product {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n }\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\nproducts(filter: {sku: {eq:\"${bundle_product_sku}\"} }) {\n total_count\n items {\n ... on PhysicalProductInterface {\n weight\n }\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on BundleProduct {\n weight\n price_view\n dynamic_price\n dynamic_sku\n ship_bundle_items\n dynamic_weight\n items {\n option_id\n title\n required\n type\n position\n sku\n options {\n id\n qty\n position\n is_default\n price\n price_type\n can_change_quantity\n product {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n }\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -41214,7 +41214,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${downloadable_product_sku}\" } })\n {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t }\n ... on DownloadableProduct {\n links_purchased_separately\n links_title\n downloadable_product_samples {\n id\n title\n sort_order\n sample_type\n sample_file\n sample_url\n }\n downloadable_product_links {\n id\n title\n sort_order\n is_shareable\n price\n number_of_downloads\n link_type\n sample_type\n sample_file\n sample_url\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${downloadable_product_sku}\" } })\n {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t }\n ... on DownloadableProduct {\n links_purchased_separately\n links_title\n downloadable_product_samples {\n id\n title\n sort_order\n sample_type\n sample_file\n sample_url\n }\n downloadable_product_links {\n id\n title\n sort_order\n is_shareable\n price\n number_of_downloads\n link_type\n sample_type\n sample_file\n sample_url\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -41301,7 +41301,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${virtual_product_sku}\" } })\n {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${virtual_product_sku}\" } })\n {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -41368,7 +41368,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\nproducts(filter: {sku: {eq:\"${grouped_product_sku}\"} }) {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on GroupedProduct {\n weight\n items {\n qty\n position\n product {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\nproducts(filter: {sku: {eq:\"${grouped_product_sku}\"} }) {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on GroupedProduct {\n weight\n items {\n qty\n position\n product {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description\n gift_message_available\n id\n image\n image_label\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description\n sku\n small_image {\n url\n }\n small_image_label\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n thumbnail_label\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> From a1c809318fb53e277a1cb391352bed8654beb23a Mon Sep 17 00:00:00 2001 From: IvanPletnyov <ivan.pletnyov@transoftgroup.com> Date: Fri, 21 Sep 2018 12:11:33 +0300 Subject: [PATCH 70/95] MSI-1650: Fix CE integration test --- .../Quote/Item/QuantityValidatorTest.php | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php index 0ac6eb3c0405b..222104e7b5641 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php @@ -170,7 +170,7 @@ private function setMockStockStateResultToQuoteItemOptions($quoteItem, $resultMo * Tests quantity verifications for configurable product. * * @param int $quantity - quantity of configurable option. - * @param string $errorMessage - expected error message. + * @param string $errorMessageRegexp - expected error message regexp. * @return void * @throws CouldNotSaveException * @throws LocalizedException @@ -179,7 +179,7 @@ private function setMockStockStateResultToQuoteItemOptions($quoteItem, $resultMo * @magentoDbIsolation enabled * @magentoAppIsolation enabled */ - public function testConfigurableWithOptions(int $quantity, string $errorMessage): void + public function testConfigurableWithOptions(int $quantity, string $errorMessageRegexp): void { /** @var ProductRepositoryInterface $productRepository */ $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); @@ -217,17 +217,16 @@ public function testConfigurableWithOptions(int $quantity, string $errorMessage) ] ); - if (!empty($errorMessage)) { - $this->expectException(LocalizedException::class); - $this->expectExceptionMessage($errorMessage); - } - - /** @var Quote $cart */ - $cart = $this->objectManager->create(CartInterface::class); - $result = $cart->addProduct($product, $request); + try { + /** @var Quote $cart */ + $cart = $this->objectManager->create(CartInterface::class); + $result = $cart->addProduct($product, $request); - if (empty($errorMessage)) { - self::assertEquals('Configurable Product', $result->getName()); + if (empty($errorMessageRegexp)) { + self::assertEquals('Configurable Product', $result->getName()); + } + } catch (LocalizedException $e) { + self::assertEquals(1, preg_match($errorMessageRegexp, $e->getMessage())); } } @@ -239,18 +238,20 @@ public function testConfigurableWithOptions(int $quantity, string $errorMessage) */ public function quantityDataProvider(): array { + $qtyRegexp = '/You can buy (this product|Configurable OptionOption 1) only in quantities of 500 at a time/'; + return [ [ 'quantity' => 1, - 'error' => 'The fewest you may purchase is 500.' + 'error_regexp' => '/The fewest you may purchase is 500\./' ], [ 'quantity' => 501, - 'error' => 'You can buy Configurable OptionOption 1 only in quantities of 500 at a time' + 'error_regexp' => $qtyRegexp ], [ 'quantity' => 1000, - 'error' => '' + 'error_regexp' => '' ], ]; From 7e8b881036d9d8b2d9d2f666d05e2bbfa686841b Mon Sep 17 00:00:00 2001 From: vprohorov <prohorov.vital@gmail.com> Date: Fri, 21 Sep 2018 11:16:02 +0300 Subject: [PATCH 71/95] MAGETWO-95105: [2.3] URL Key column with accented characters not converted after importing the CSV file - Adding integration test --- .../product_simple_with_wrong_url_key.php | 38 ++++++++++++++++++ ...uct_simple_with_wrong_url_key_rollback.php | 29 ++++++++++++++ .../Model/Import/ProductTest.php | 40 +++++++++++++++++++ ...oducts_to_import_with_invalid_url_keys.csv | 4 ++ 4 files changed, 111 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_wrong_url_key.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_wrong_url_key_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_invalid_url_keys.csv diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_wrong_url_key.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_wrong_url_key.php new file mode 100644 index 0000000000000..5012bc947211b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_wrong_url_key.php @@ -0,0 +1,38 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +/** @var $product \Magento\Catalog\Model\Product */ +$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class); +$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Simple Product') + ->setSku('simple1') + ->setPrice(10) + ->setDescription('Description with <b>html tag</b>') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setCategoryIds([2]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setUrlKey('cuvee-merlot-cabernet-igp-pays-d-oc-frankrijk') + ->save(); + +/** @var $product \Magento\Catalog\Model\Product */ +$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class); +$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Simple Product 2') + ->setSku('simple2') + ->setPrice(10) + ->setDescription('Description with <b>html tag</b>') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setCategoryIds([2]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setUrlKey('normal-url') + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_wrong_url_key_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_wrong_url_key_rollback.php new file mode 100644 index 0000000000000..778fa7b15df3e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_wrong_url_key_rollback.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Exception\NoSuchEntityException; + +\Magento\TestFramework\Helper\Bootstrap::getInstance()->getInstance()->reinitialize(); + +/** @var \Magento\Framework\Registry $registry */ +$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ +$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); +try { + $product = $productRepository->get('simple1', false, null, true); + $productRepository->delete($product); + $product = $productRepository->get('simple2', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { +} +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php index c5e704c2434b5..237d7660da9bd 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -1566,6 +1566,46 @@ public function testExistingProductWithUrlKeys() } } + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_wrong_url_key.php + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ + public function testAddUpdateProductWithInvalidUrlKeys() : void + { + $products = [ + 'simple1' => 'cuvee-merlot-cabernet-igp-pays-d-oc-frankrijk', + 'simple2' => 'normal-url', + 'simple3' => 'some-wrong-url' + ]; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/_files/products_to_import_with_invalid_url_keys.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + foreach ($products as $productSku => $productUrlKey) { + $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); + } + } + /** * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php * @magentoDbIsolation disabled diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_invalid_url_keys.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_invalid_url_keys.csv new file mode 100644 index 0000000000000..25bb95ab9e0fd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_with_invalid_url_keys.csv @@ -0,0 +1,4 @@ +sku,product_type,store_view_code,name,price,attribute_set_code,url_key +simple1,simple,,"simple 1",25,Default,cuvée merlot-cabernet igp pays d'oc frankrijk +simple2,simple,,"simple 2",34,Default,normal-url +simple3,simple,,"simple 3",58,Default,some!wrong'url From 8d9890fa085916140e196000233e337d760c0010 Mon Sep 17 00:00:00 2001 From: IvanPletnyov <ivan.pletnyov@transoftgroup.com> Date: Fri, 21 Sep 2018 17:26:57 +0300 Subject: [PATCH 72/95] MSI-1650 contains: MSI-1674: Adapt Static Test which checks DevBlocks to exclude all Inventory* modules --- dev/tests/static/framework/Magento/ruleset.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/tests/static/framework/Magento/ruleset.xml b/dev/tests/static/framework/Magento/ruleset.xml index cc0a5f43e084a..b9aa3d1792c36 100644 --- a/dev/tests/static/framework/Magento/ruleset.xml +++ b/dev/tests/static/framework/Magento/ruleset.xml @@ -26,18 +26,21 @@ <exclude-pattern>*/_files/*</exclude-pattern> <exclude-pattern>*/Test/*</exclude-pattern> <exclude-pattern>*Test.php</exclude-pattern> + <exclude-pattern>*/Inventory*/*</exclude-pattern> </rule> <rule ref="Magento.Annotation.MethodAnnotationStructure"> <include-pattern>*\.(php)</include-pattern> <exclude-pattern>*/Test/*</exclude-pattern> <exclude-pattern>*Test.php</exclude-pattern> <exclude-pattern>*/_files/*</exclude-pattern> + <exclude-pattern>*/Inventory*/*</exclude-pattern> </rule> <rule ref="Magento.Annotation.ClassAnnotationStructure"> <include-pattern>*\.(php)</include-pattern> <exclude-pattern>*/Test/*</exclude-pattern> <exclude-pattern>*Test.php</exclude-pattern> <exclude-pattern>*/_files/*</exclude-pattern> + <exclude-pattern>*/Inventory*/*</exclude-pattern> </rule> <rule ref="Magento.Functions.OutputBuffering"> <include-pattern>*/(app/code|vendor|setup/src|lib/internal/Magento)/*</include-pattern> From 6362c4b3f0e15fadd65dd34095fe6b9fddf9b620 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Fri, 21 Sep 2018 10:13:17 -0500 Subject: [PATCH 73/95] =?UTF-8?q?MAGETWO-91034:=20Renaming=20of=20new=20se?= =?UTF-8?q?tup=20commands=20and=20setup:install/setup=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix static --- .../Magento/Developer/Console/Command/GeneratePatchCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php b/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php index 15cad9586c2be..d224c13b5a6b4 100644 --- a/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php +++ b/app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php @@ -48,6 +48,8 @@ public function __construct(ComponentRegistrar $componentRegistrar) } /** + * Configure command + * * @inheritdoc * @throws InvalidArgumentException */ From 813209e690f8367ffd9d006f48e70cdd001c6976 Mon Sep 17 00:00:00 2001 From: James Calcaben <calcaben@adobe.com> Date: Fri, 21 Sep 2018 09:40:34 -0500 Subject: [PATCH 74/95] MAGEDOC-3150: Add link to release notes in magento2 CHANGELOG.md - Release notes for 2.3.0 added --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 078b93bd7199c..cc722b6d61b33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +2.3.0 +============= +To get detailed information about changes in Magento 2.3.0, see the [Release Notes](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html) + 2.1.0 ============= To get detailed information about changes in Magento 2.1.0, please visit [Magento Community Edition (CE) Release Notes](http://devdocs.magento.com/guides/v2.1/release-notes/ReleaseNotes2.1.0CE.html "Magento Community Edition (CE) Release Notes") From 6efdce8ac553a1e4a8b5806b0717db46b1bc7ed1 Mon Sep 17 00:00:00 2001 From: Igor Miniailo <igor.minyaylo@gmail.com> Date: Fri, 21 Sep 2018 19:55:27 +0300 Subject: [PATCH 75/95] Fix Custom Magento coding standard. Exclude Inventory modules --- dev/tests/static/framework/Magento/ruleset.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/static/framework/Magento/ruleset.xml b/dev/tests/static/framework/Magento/ruleset.xml index b9aa3d1792c36..5bdc0af4e1894 100644 --- a/dev/tests/static/framework/Magento/ruleset.xml +++ b/dev/tests/static/framework/Magento/ruleset.xml @@ -26,21 +26,21 @@ <exclude-pattern>*/_files/*</exclude-pattern> <exclude-pattern>*/Test/*</exclude-pattern> <exclude-pattern>*Test.php</exclude-pattern> - <exclude-pattern>*/Inventory*/*</exclude-pattern> + <exclude-pattern>*/Magento/Inventory*/*</exclude-pattern> </rule> <rule ref="Magento.Annotation.MethodAnnotationStructure"> <include-pattern>*\.(php)</include-pattern> <exclude-pattern>*/Test/*</exclude-pattern> <exclude-pattern>*Test.php</exclude-pattern> <exclude-pattern>*/_files/*</exclude-pattern> - <exclude-pattern>*/Inventory*/*</exclude-pattern> + <exclude-pattern>*/Magento/Inventory*/*</exclude-pattern> </rule> <rule ref="Magento.Annotation.ClassAnnotationStructure"> <include-pattern>*\.(php)</include-pattern> <exclude-pattern>*/Test/*</exclude-pattern> <exclude-pattern>*Test.php</exclude-pattern> <exclude-pattern>*/_files/*</exclude-pattern> - <exclude-pattern>*/Inventory*/*</exclude-pattern> + <exclude-pattern>*/Magento/Inventory*/*</exclude-pattern> </rule> <rule ref="Magento.Functions.OutputBuffering"> <include-pattern>*/(app/code|vendor|setup/src|lib/internal/Magento)/*</include-pattern> From 38dfdd8c714f11e67dc7a2495cc16c08d794a71d Mon Sep 17 00:00:00 2001 From: mage2pratik <magepratik@gmail.com> Date: Sat, 22 Sep 2018 00:16:44 +0530 Subject: [PATCH 76/95] Replace sort callbacks to spaceship operator --- .../Magento/Backend/Block/Widget/Button/ButtonList.php | 8 +------- app/code/Magento/Bundle/Model/Product/Type.php | 6 ++---- .../Config/Model/Config/Structure/Mapper/Sorting.php | 6 +----- .../Deploy/Model/DeploymentConfig/ImporterPool.php | 9 +-------- app/code/Magento/Paypal/Model/Express/Checkout.php | 5 +---- .../Sales/Block/Adminhtml/Order/View/Tab/History.php | 6 +----- app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php | 6 +----- app/code/Magento/Ui/DataProvider/Modifier/Pool.php | 9 +-------- .../Test/Constraint/AssertDownloadableDuplicateForm.php | 6 +----- 9 files changed, 10 insertions(+), 51 deletions(-) diff --git a/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php b/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php index ced07fb662f14..e2d71d171cf15 100644 --- a/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php +++ b/app/code/Magento/Backend/Block/Widget/Button/ButtonList.php @@ -127,12 +127,6 @@ public function getItems() */ public function sortButtons(Item $itemA, Item $itemB) { - $sortOrderA = (int) $itemA->getSortOrder(); - $sortOrderB = (int) $itemB->getSortOrder(); - - if ($sortOrderA == $sortOrderB) { - return 0; - } - return ($sortOrderA < $sortOrderB) ? -1 : 1; + return (int)$itemA->getSortOrder() <=> (int)$itemB->getSortOrder(); } } diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index d25f856e0b40d..92bada8094c7e 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -1014,10 +1014,8 @@ public function shakeSelections($firstItem, $secondItem) $secondItem->getPosition(), $secondItem->getSelectionId(), ]; - if ($aPosition == $bPosition) { - return 0; - } - return $aPosition < $bPosition ? -1 : 1; + + return $aPosition <=> $bPosition; } /** diff --git a/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php b/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php index 2733847bab1d0..e615678550108 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php +++ b/app/code/Magento/Config/Model/Config/Structure/Mapper/Sorting.php @@ -62,10 +62,6 @@ protected function _cmp($elementA, $elementB) $sortIndexB = (float)$elementB['sortOrder']; } - if ($sortIndexA == $sortIndexB) { - return 0; - } - - return $sortIndexA < $sortIndexB ? -1 : 1; + return $sortIndexA <=> $sortIndexB; } } diff --git a/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php b/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php index a4a9ef00c4a83..cae76a4c2591f 100644 --- a/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php +++ b/app/code/Magento/Deploy/Model/DeploymentConfig/ImporterPool.php @@ -187,14 +187,7 @@ public function getValidator($section) private function sort(array $data) { uasort($data, function (array $a, array $b) { - $a['sort_order'] = $this->getSortOrder($a); - $b['sort_order'] = $this->getSortOrder($b); - - if ($a['sort_order'] == $b['sort_order']) { - return 0; - } - - return ($a['sort_order'] < $b['sort_order']) ? -1 : 1; + return $this->getSortOrder($a) <=> $this->getSortOrder($b); }); return $data; diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 1300c79368943..856e01f7353f2 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -1056,10 +1056,7 @@ protected function _prepareShippingOptions(Address $address, $mayReturnEmpty = f */ protected static function cmpShippingOptions(DataObject $option1, DataObject $option2) { - if ($option1->getAmount() == $option2->getAmount()) { - return 0; - } - return ($option1->getAmount() < $option2->getAmount()) ? -1 : 1; + return $option1->getAmount() <=> $option2->getAmount(); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php index 64b53d10d4af6..30b0872dfa90d 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php @@ -303,11 +303,7 @@ public static function sortHistoryByTimestamp($a, $b) $createdAtA = $a['created_at']; $createdAtB = $b['created_at']; - /** @var $createdAtA \DateTime */ - if ($createdAtA->getTimestamp() == $createdAtB->getTimestamp()) { - return 0; - } - return $createdAtA->getTimestamp() < $createdAtB->getTimestamp() ? -1 : 1; + return $createdAtA->getTimestamp() <=> $createdAtB->getTimestamp(); } /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index 401fdcd2b04ac..2989e8a95c198 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -641,11 +641,7 @@ protected function _sortTotalsList($a, $b) return 0; } - if ($a['sort_order'] == $b['sort_order']) { - return 0; - } - - return $a['sort_order'] > $b['sort_order'] ? 1 : -1; + return $a['sort_order'] <=> $b['sort_order']; } /** diff --git a/app/code/Magento/Ui/DataProvider/Modifier/Pool.php b/app/code/Magento/Ui/DataProvider/Modifier/Pool.php index 34a24499834d2..882f97d57e9fb 100644 --- a/app/code/Magento/Ui/DataProvider/Modifier/Pool.php +++ b/app/code/Magento/Ui/DataProvider/Modifier/Pool.php @@ -88,14 +88,7 @@ public function getModifiersInstances() protected function sort(array $data) { usort($data, function (array $a, array $b) { - $a['sortOrder'] = $this->getSortOrder($a); - $b['sortOrder'] = $this->getSortOrder($b); - - if ($a['sortOrder'] == $b['sortOrder']) { - return 0; - } - - return ($a['sortOrder'] < $b['sortOrder']) ? -1 : 1; + return $this->getSortOrder($a) <=> $this->getSortOrder($b); }); return $data; diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php index e5d97e1511e71..2033189214e12 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php @@ -32,11 +32,7 @@ protected function sortDownloadableArray(array $fields) usort( $fields, function ($row1, $row2) { - if ($row1['sort_order'] == $row2['sort_order']) { - return 0; - } - - return ($row1['sort_order'] < $row2['sort_order']) ? -1 : 1; + return $row1['sort_order'] <=> $row2['sort_order']; } ); From b4503ecea224be9fb8976a7927325af3377ab4ce Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Fri, 21 Sep 2018 17:14:52 -0500 Subject: [PATCH 77/95] MSI-1650: Fix CE integration test. - update regex in integration tests - skip MTF test --- .../TestCase/Product/ProductTypeSwitchingOnCreationTest.xml | 1 + .../CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml index 7c4824c604e29..460cc29b183e0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnCreationTest.xml @@ -77,6 +77,7 @@ <data name="createProduct" xsi:type="string">downloadable</data> <data name="product" xsi:type="string">configurableProduct::not_virtual_for_type_switching</data> <data name="actionName" xsi:type="string">clearDownloadableData</data> + <data name="issue" xsi:type="string">MSI-1624</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" /> <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertChildProductsInGrid" /> diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php index 222104e7b5641..6105aba9201e2 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php @@ -243,7 +243,7 @@ public function quantityDataProvider(): array return [ [ 'quantity' => 1, - 'error_regexp' => '/The fewest you may purchase is 500\./' + 'error_regexp' => '/The fewest you may purchase is 500/' ], [ 'quantity' => 501, From 0a42696f6149d3c35082b458ceced6d1ff2f7a61 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Fri, 21 Sep 2018 18:01:44 -0500 Subject: [PATCH 78/95] =?UTF-8?q?MAGETWO-91034:=20Renaming=20of=20new=20se?= =?UTF-8?q?tup=20commands=20and=20setup:install/setup=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix setup for disabled modules --- setup/src/Magento/Setup/Model/Installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/src/Magento/Setup/Model/Installer.php b/setup/src/Magento/Setup/Model/Installer.php index 394725472578f..c7a84b0cf022e 100644 --- a/setup/src/Magento/Setup/Model/Installer.php +++ b/setup/src/Magento/Setup/Model/Installer.php @@ -56,8 +56,8 @@ class Installer /**#@+ * Parameters for enabling/disabling modules */ - const ENABLE_MODULES = 'enable_modules'; - const DISABLE_MODULES = 'disable_modules'; + const ENABLE_MODULES = 'enable-modules'; + const DISABLE_MODULES = 'disable-modules'; /**#@- */ /**#@+ From e20dfc360361d783643b42d2ef7c20206eeed51e Mon Sep 17 00:00:00 2001 From: Volodymyr Hryvinskyi <volodymyr@hryvinskyi.com> Date: Sat, 22 Sep 2018 21:54:09 +0300 Subject: [PATCH 79/95] Replace 'Rule Id' to 'Rule ID' --- app/code/Magento/CatalogRule/etc/db_schema.xml | 12 ++++++------ app/code/Magento/SalesRule/etc/db_schema.xml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/CatalogRule/etc/db_schema.xml b/app/code/Magento/CatalogRule/etc/db_schema.xml index 537ed75e7d55e..25c9d866167ce 100644 --- a/app/code/Magento/CatalogRule/etc/db_schema.xml +++ b/app/code/Magento/CatalogRule/etc/db_schema.xml @@ -39,7 +39,7 @@ <column xsi:type="int" name="rule_product_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Rule Product Id"/> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="int" name="from_time" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="From Time"/> <column xsi:type="int" name="to_time" padding="10" unsigned="true" nullable="false" identity="false" default="0" @@ -119,7 +119,7 @@ </table> <table name="catalogrule_group_website" resource="default" engine="innodb" comment="CatalogRule Group Website"> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="Customer Group Id"/> <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false" @@ -138,7 +138,7 @@ </table> <table name="catalogrule_website" resource="default" engine="innodb" comment="Catalog Rules To Websites Relations"> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false" comment="Website Id"/> <constraint xsi:type="primary" name="PRIMARY"> @@ -158,7 +158,7 @@ <table name="catalogrule_customer_group" resource="default" engine="innodb" comment="Catalog Rules To Customer Groups Relations"> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Customer Group Id"/> <constraint xsi:type="primary" name="PRIMARY"> @@ -179,7 +179,7 @@ <column xsi:type="int" name="rule_product_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Rule Product Id"/> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="int" name="from_time" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="From Time"/> <column xsi:type="int" name="to_time" padding="10" unsigned="true" nullable="false" identity="false" default="0" @@ -261,7 +261,7 @@ <table name="catalogrule_group_website_replica" resource="default" engine="innodb" comment="CatalogRule Group Website"> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="Customer Group Id"/> <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false" diff --git a/app/code/Magento/SalesRule/etc/db_schema.xml b/app/code/Magento/SalesRule/etc/db_schema.xml index 8a125eb555fbe..145ed0c96d95f 100644 --- a/app/code/Magento/SalesRule/etc/db_schema.xml +++ b/app/code/Magento/SalesRule/etc/db_schema.xml @@ -60,7 +60,7 @@ <column xsi:type="int" name="coupon_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Coupon Id"/> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="varchar" name="code" nullable="true" length="255" comment="Code"/> <column xsi:type="int" name="usage_limit" padding="10" unsigned="true" nullable="true" identity="false" comment="Usage Limit"/> @@ -117,7 +117,7 @@ <column xsi:type="int" name="rule_customer_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Rule Customer Id"/> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="Customer Id"/> <column xsi:type="smallint" name="times_used" padding="5" unsigned="true" nullable="false" identity="false" @@ -143,7 +143,7 @@ <column xsi:type="int" name="label_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Label Id"/> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false" comment="Store Id"/> <column xsi:type="varchar" name="label" nullable="true" length="255" comment="Label"/> @@ -164,7 +164,7 @@ </table> <table name="salesrule_product_attribute" resource="default" engine="innodb" comment="Salesrule Product Attribute"> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false" comment="Website Id"/> <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false" @@ -320,7 +320,7 @@ </table> <table name="salesrule_website" resource="default" engine="innodb" comment="Sales Rules To Websites Relations"> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false" comment="Website Id"/> <constraint xsi:type="primary" name="PRIMARY"> @@ -339,7 +339,7 @@ <table name="salesrule_customer_group" resource="default" engine="innodb" comment="Sales Rules To Customer Groups Relations"> <column xsi:type="int" name="rule_id" padding="10" unsigned="true" nullable="false" identity="false" - comment="Rule Id"/> + comment="Rule ID"/> <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Customer Group Id"/> <constraint xsi:type="primary" name="PRIMARY"> From 85422338bc2eb0bb337c1602a51209e8e4be39bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Lavorel?= <aurelien@lavoweb.net> Date: Tue, 4 Sep 2018 18:23:45 +0200 Subject: [PATCH 80/95] rich snippet declaration on grouped product --- .../view/base/templates/product/price/final_price.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/GroupedProduct/view/base/templates/product/price/final_price.phtml b/app/code/Magento/GroupedProduct/view/base/templates/product/price/final_price.phtml index 34de1a18cf28a..d9238e9794d7e 100644 --- a/app/code/Magento/GroupedProduct/view/base/templates/product/price/final_price.phtml +++ b/app/code/Magento/GroupedProduct/view/base/templates/product/price/final_price.phtml @@ -26,7 +26,7 @@ if ($minProduct) { ); } ?> -<div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> +<div class="price-box"> <?php if ($minProduct && \Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW != $block->getZone()): ?> <p class="minimal-price"> <span class="price-label"><?= /* @escapeNotVerified */ __('Starting at') ?></span><?= $amountRender->toHtml() ?> From edd2e93a251424577f231f574d2424c4e06248d0 Mon Sep 17 00:00:00 2001 From: Alex Gusev <alex@flancer64.com> Date: Fri, 24 Aug 2018 11:48:56 +0300 Subject: [PATCH 81/95] Current password autocomplete for admin login Browsers have an autocomplete functionality with permissions for every site separately. It is a user's decision - enable/disable autocomplete for the certain site, not developer's is. --- .../Backend/view/adminhtml/templates/admin/login.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml b/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml index 805e9783f3f18..528c13fc874aa 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml @@ -27,7 +27,7 @@ value="" data-validate="{required:true}" placeholder="<?= /* @escapeNotVerified */ __('user name') ?>" - autocomplete="off" + autocomplete="on" /> </div> </div> @@ -43,7 +43,7 @@ data-validate="{required:true}" value="" placeholder="<?= /* @escapeNotVerified */ __('password') ?>" - autocomplete="new-password" + autocomplete="current-password" /> </div> </div> From 692e89e106210cc1a63ca0e257a172e65a961bc2 Mon Sep 17 00:00:00 2001 From: Alex Gusev <alex@flancer64.com> Date: Fri, 14 Sep 2018 12:33:45 +0300 Subject: [PATCH 82/95] Switch off autocomplete see https://github.com/magento/magento2/pull/17783#issuecomment-421235681 --- .../Backend/view/adminhtml/templates/admin/login.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml b/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml index 528c13fc874aa..52d5dd6d114ee 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml @@ -27,7 +27,7 @@ value="" data-validate="{required:true}" placeholder="<?= /* @escapeNotVerified */ __('user name') ?>" - autocomplete="on" + autocomplete="off" /> </div> </div> @@ -43,7 +43,7 @@ data-validate="{required:true}" value="" placeholder="<?= /* @escapeNotVerified */ __('password') ?>" - autocomplete="current-password" + autocomplete="off" /> </div> </div> From a2d9d2b9b7fa04e61716c8160d4bcaa7cc98685e Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk <t.blindaruk@gmail.com> Date: Wed, 5 Sep 2018 23:56:03 +0300 Subject: [PATCH 83/95] return $this from setters in Analytics/ReportXml/DB/SelectBuilder.php --- .../Analytics/ReportXml/DB/SelectBuilder.php | 32 ++++++++++++++----- .../Unit/ReportXml/DB/SelectBuilderTest.php | 12 +++---- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php b/app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php index 81ee9b15781d1..f61e02988103a 100644 --- a/app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php +++ b/app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php @@ -85,11 +85,13 @@ public function getJoins() * Set joins conditions * * @param array $joins - * @return void + * @return $this */ public function setJoins($joins) { $this->joins = $joins; + + return $this; } /** @@ -106,11 +108,13 @@ public function getConnectionName() * Set connection name * * @param string $connectionName - * @return void + * @return $this */ public function setConnectionName($connectionName) { $this->connectionName = $connectionName; + + return $this; } /** @@ -127,11 +131,13 @@ public function getColumns() * Set columns * * @param array $columns - * @return void + * @return $this */ public function setColumns($columns) { $this->columns = $columns; + + return $this; } /** @@ -148,11 +154,13 @@ public function getFilters() * Set filters * * @param array $filters - * @return void + * @return $this */ public function setFilters($filters) { $this->filters = $filters; + + return $this; } /** @@ -169,11 +177,13 @@ public function getFrom() * Set from condition * * @param array $from - * @return void + * @return $this */ public function setFrom($from) { $this->from = $from; + + return $this; } /** @@ -236,11 +246,13 @@ public function getGroup() * Set group * * @param array $group - * @return void + * @return $this */ public function setGroup($group) { $this->group = $group; + + return $this; } /** @@ -257,11 +269,13 @@ public function getParams() * Set parameters * * @param array $params - * @return void + * @return $this */ public function setParams($params) { $this->params = $params; + + return $this; } /** @@ -278,10 +292,12 @@ public function getHaving() * Set having condition * * @param array $having - * @return void + * @return $this */ public function setHaving($having) { $this->having = $having; + + return $this; } } diff --git a/app/code/Magento/Analytics/Test/Unit/ReportXml/DB/SelectBuilderTest.php b/app/code/Magento/Analytics/Test/Unit/ReportXml/DB/SelectBuilderTest.php index 8be2f0ee968ef..a4362d583dfbc 100644 --- a/app/code/Magento/Analytics/Test/Unit/ReportXml/DB/SelectBuilderTest.php +++ b/app/code/Magento/Analytics/Test/Unit/ReportXml/DB/SelectBuilderTest.php @@ -64,12 +64,12 @@ public function testCreate() ['link-type' => 'right', 'table' => 'attribute', 'condition' => 'neq'], ]; $groups = ['id', 'name']; - $this->selectBuilder->setConnectionName($connectionName); - $this->selectBuilder->setFrom($from); - $this->selectBuilder->setColumns($columns); - $this->selectBuilder->setFilters([$filter]); - $this->selectBuilder->setJoins($joins); - $this->selectBuilder->setGroup($groups); + $this->selectBuilder->setConnectionName($connectionName) + ->setFrom($from) + ->setColumns($columns) + ->setFilters([$filter]) + ->setJoins($joins) + ->setGroup($groups); $this->resourceConnectionMock->expects($this->once()) ->method('getConnection') ->with($connectionName) From 8b9fff56f2172bb2e3fa5bde4d16daa18df97e22 Mon Sep 17 00:00:00 2001 From: francesco <francesco.h@thesiteup.com> Date: Sat, 8 Sep 2018 11:33:12 +0200 Subject: [PATCH 84/95] Fix module uninstall shell command and composer removal w/out regression --- lib/internal/Magento/Framework/Composer/Remove.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Composer/Remove.php b/lib/internal/Magento/Framework/Composer/Remove.php index b7a9a20333d86..b7cea7769a176 100644 --- a/lib/internal/Magento/Framework/Composer/Remove.php +++ b/lib/internal/Magento/Framework/Composer/Remove.php @@ -46,7 +46,7 @@ public function remove(array $packages) [ 'command' => 'remove', 'packages' => $packages, - '--no-update' => true, + '--no-update-with-dependencies' => true, ] ); } From fa4289fe8534a2af5aeb69839ba0df6aa21a55ed Mon Sep 17 00:00:00 2001 From: francesco <francesco.h@thesiteup.com> Date: Mon, 10 Sep 2018 13:18:29 +0200 Subject: [PATCH 85/95] test updated --- .../testsuite/Magento/Framework/Composer/RemoveTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php b/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php index bfe8264d7cce6..211b28617cbe2 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php @@ -24,7 +24,7 @@ public function testRemove() [ 'command' => 'remove', 'packages' => ['magento/package-a', 'magento/package-b'], - '--no-update' => true, + '--no-update-with-dependencies' => true, ] ); $composerAppFactory->expects($this->once()) From 74e1ea92cb57d739d3552fa9b86c51a8d5d8cfe9 Mon Sep 17 00:00:00 2001 From: Pieter Hoste <hoste.pieter@gmail.com> Date: Sat, 1 Sep 2018 16:01:25 +0200 Subject: [PATCH 86/95] [Forwardport] Make sure all linked products (related, upsells, crosssells) show up in the backend grids and in the correct order. Fixes #13720 (cherry picked from commit a3f1c384e77ea1e693b18462e82091cf72965269) --- .../Model/ProductLink/CollectionProvider.php | 22 +++++++++---------- .../Unit/Model/CollectionProviderTest.php | 20 ++++++++++++----- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php b/app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php index bc212adae2c32..24ba5cb627896 100644 --- a/app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php +++ b/app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php @@ -47,22 +47,20 @@ public function getCollection(\Magento\Catalog\Model\Product $product, $type) $products = $this->providers[$type]->getLinkedProducts($product); $converter = $this->converterPool->getConverter($type); - $output = []; $sorterItems = []; foreach ($products as $item) { - $output[$item->getId()] = $converter->convert($item); + $itemId = $item->getId(); + $sorterItems[$itemId] = $converter->convert($item); + $sorterItems[$itemId]['position'] = $sorterItems[$itemId]['position'] ?? 0; } - foreach ($output as $item) { - $itemPosition = $item['position']; - if (!isset($sorterItems[$itemPosition])) { - $sorterItems[$itemPosition] = $item; - } else { - $newPosition = $itemPosition + 1; - $sorterItems[$newPosition] = $item; - } - } - ksort($sorterItems); + usort($sorterItems, function ($itemA, $itemB) { + $posA = intval($itemA['position']); + $posB = intval($itemB['position']); + + return $posA <=> $posB; + }); + return $sorterItems; } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CollectionProviderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CollectionProviderTest.php index d8931cbbfcf73..f0e17c7938b27 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/CollectionProviderTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/CollectionProviderTest.php @@ -57,10 +57,14 @@ public function testGetCollection() $linkedProductOneMock = $this->createMock(Product::class); $linkedProductTwoMock = $this->createMock(Product::class); $linkedProductThreeMock = $this->createMock(Product::class); + $linkedProductFourMock = $this->createMock(Product::class); + $linkedProductFiveMock = $this->createMock(Product::class); $linkedProductOneMock->expects($this->once())->method('getId')->willReturn(1); $linkedProductTwoMock->expects($this->once())->method('getId')->willReturn(2); $linkedProductThreeMock->expects($this->once())->method('getId')->willReturn(3); + $linkedProductFourMock->expects($this->once())->method('getId')->willReturn(4); + $linkedProductFiveMock->expects($this->once())->method('getId')->willReturn(5); $this->converterPoolMock->expects($this->once()) ->method('getConverter') @@ -71,9 +75,11 @@ public function testGetCollection() [$linkedProductOneMock, ['name' => 'Product One', 'position' => 10]], [$linkedProductTwoMock, ['name' => 'Product Two', 'position' => 2]], [$linkedProductThreeMock, ['name' => 'Product Three', 'position' => 2]], + [$linkedProductFourMock, ['name' => 'Product Four', 'position' => null]], + [$linkedProductFiveMock, ['name' => 'Product Five']], ]; - $this->converterMock->expects($this->exactly(3))->method('convert')->willReturnMap($map); + $this->converterMock->expects($this->exactly(5))->method('convert')->willReturnMap($map); $this->providerMock->expects($this->once()) ->method('getLinkedProducts') @@ -82,14 +88,18 @@ public function testGetCollection() [ $linkedProductOneMock, $linkedProductTwoMock, - $linkedProductThreeMock + $linkedProductThreeMock, + $linkedProductFourMock, + $linkedProductFiveMock, ] ); $expectedResult = [ - 2 => ['name' => 'Product Two', 'position' => 2], - 3 => ['name' => 'Product Three', 'position' => 2], - 10 => ['name' => 'Product One', 'position' => 10], + 0 => ['name' => 'Product Four', 'position' => 0], + 1 => ['name' => 'Product Five', 'position' => 0], + 2 => ['name' => 'Product Three', 'position' => 2], + 3 => ['name' => 'Product Two', 'position' => 2], + 4 => ['name' => 'Product One', 'position' => 10], ]; $actualResult = $this->model->getCollection($this->productMock, 'crosssell'); From d5b6231a241ade0acf154f8e88de88714b8e5cff Mon Sep 17 00:00:00 2001 From: Pieter Hoste <hoste.pieter@gmail.com> Date: Sun, 23 Sep 2018 14:39:24 +0200 Subject: [PATCH 87/95] Satisfy static tests. --- .../Magento/Catalog/Model/ProductLink/CollectionProvider.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php b/app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php index 24ba5cb627896..13f0dbf79a1b9 100644 --- a/app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php +++ b/app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php @@ -9,6 +9,9 @@ use Magento\Catalog\Model\ProductLink\Converter\ConverterPool; use Magento\Framework\Exception\NoSuchEntityException; +/** + * Provides a collection of linked product items (crosssells, related, upsells, ...) + */ class CollectionProvider { /** From 47f791a21c5d2d40d3dd0585f106f0ad2ca35664 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 10 Sep 2018 17:22:50 +0300 Subject: [PATCH 88/95] Covering the CategoryProcessUrlRewriteMovingObserver by Unit Test --- ...oryProcessUrlRewriteMovingObserverTest.php | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php new file mode 100644 index 0000000000000..d9b0c14b2a342 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php @@ -0,0 +1,151 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Test\Unit\Observer; + +use Magento\Catalog\Model\Category; +use Magento\CatalogUrlRewrite\Block\UrlKeyRenderer; +use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator; +use Magento\CatalogUrlRewrite\Model\Map\DatabaseMapPool; +use Magento\CatalogUrlRewrite\Model\Map\DataCategoryUrlRewriteDatabaseMap; +use Magento\CatalogUrlRewrite\Model\Map\DataProductUrlRewriteDatabaseMap; +use Magento\CatalogUrlRewrite\Model\UrlRewriteBunchReplacer; +use Magento\CatalogUrlRewrite\Observer\CategoryProcessUrlRewriteMovingObserver; +use Magento\CatalogUrlRewrite\Observer\UrlRewriteHandler; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Event; +use Magento\Framework\Event\Observer; +use Magento\UrlRewrite\Model\UrlPersistInterface; +use PHPUnit\Framework\TestCase; + +/** + * Class CategoryProcessUrlRewriteMovingObserverTest + * + * @covers \Magento\CatalogUrlRewrite\Observer\CategoryProcessUrlRewriteMovingObserver + */ +class CategoryProcessUrlRewriteMovingObserverTest extends TestCase +{ + /** + * @var CategoryProcessUrlRewriteMovingObserver + */ + private $observer; + + /** + * @var CategoryUrlRewriteGenerator|\PHPUnit_Framework_MockObject_MockObject + */ + private $categoryUrlRewriteGeneratorMock; + + /** + * @var UrlPersistInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $urlPersistMock; + + /** + * @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $scopeConfigMock; + + /** + * @var UrlRewriteHandler|\PHPUnit_Framework_MockObject_MockObject + */ + private $urlRewriteHandlerMock; + + /** + * @var UrlRewriteBunchReplacer|\PHPUnit_Framework_MockObject_MockObject + */ + private $urlRewriteBunchReplacerMock; + + /** + * @var DatabaseMapPool|\PHPUnit_Framework_MockObject_MockObject + */ + private $databaseMapPoolMock; + + /** + * Set Up + */ + protected function setUp() + { + $this->categoryUrlRewriteGeneratorMock = $this->createMock(CategoryUrlRewriteGenerator::class); + $this->urlPersistMock = $this->createMock(UrlPersistInterface::class); + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->urlRewriteHandlerMock = $this->createMock(UrlRewriteHandler::class); + $this->urlRewriteBunchReplacerMock = $this->createPartialMock(UrlRewriteBunchReplacer::class, + ['doBunchReplace'] + ); + $this->databaseMapPoolMock = $this->createMock(DatabaseMapPool::class); + + $this->observer = new CategoryProcessUrlRewriteMovingObserver( + $this->categoryUrlRewriteGeneratorMock, + $this->urlPersistMock, + $this->scopeConfigMock, + $this->urlRewriteHandlerMock, + $this->urlRewriteBunchReplacerMock, + $this->databaseMapPoolMock, + [ + DataCategoryUrlRewriteDatabaseMap::class, + DataProductUrlRewriteDatabaseMap::class + ] + ); + } + + /** + * Test category process rewrite url by changing the parent + * + * @return void + */ + public function testCategoryProcessUrlRewriteAfterMovingWithChangedParentId() + { + /** @var Observer|\PHPUnit_Framework_MockObject_MockObject $observerMock */ + $observerMock = $this->createMock(Observer::class); + $eventMock = $this->getMockBuilder(Event::class) + ->disableOriginalConstructor() + ->setMethods(['getCategory']) + ->getMock(); + $categoryMock = $this->createPartialMock(Category::class, [ + 'dataHasChangedFor', + 'getEntityId', + 'getStoreId', + 'setData' + ]); + + $categoryMock->expects($this->once())->method('dataHasChangedFor')->with('parent_id') + ->willReturn(true); + $eventMock->expects($this->once())->method('getCategory')->willReturn($categoryMock); + $observerMock->expects($this->once())->method('getEvent')->willReturn($eventMock); + $this->scopeConfigMock->expects($this->once())->method('isSetFlag') + ->with(UrlKeyRenderer::XML_PATH_SEO_SAVE_HISTORY)->willReturn(true); + $this->categoryUrlRewriteGeneratorMock->expects($this->once())->method('generate') + ->with($categoryMock, true)->willReturn(['category-url-rewrite']); + $this->urlRewriteHandlerMock->expects($this->once())->method('generateProductUrlRewrites') + ->with($categoryMock)->willReturn(['product-url-rewrite']); + $this->databaseMapPoolMock->expects($this->exactly(2))->method('resetMap')->willReturnSelf(); + + $this->observer->execute($observerMock); + } + + /** + * Test category process rewrite url without changing the parent + * + * @return void + */ + public function testCategoryProcessUrlRewriteAfterMovingWithinNotChangedParent() + { + /** @var Observer|\PHPUnit_Framework_MockObject_MockObject $observerMock */ + $observerMock = $this->createMock(Observer::class); + $eventMock = $this->getMockBuilder(Event::class) + ->disableOriginalConstructor() + ->setMethods(['getCategory']) + ->getMock(); + $categoryMock = $this->createPartialMock(Category::class, ['dataHasChangedFor']); + $observerMock->expects($this->once())->method('getEvent')->willReturn($eventMock); + $eventMock->expects($this->once())->method('getCategory')->willReturn($categoryMock); + $categoryMock->expects($this->once())->method('dataHasChangedFor')->with('parent_id') + ->willReturn(false); + + $this->observer->execute($observerMock); + } +} From 94ed408b61c46d86c4adeefe273c16447b565e42 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza <enarc@atwix.com> Date: Mon, 10 Sep 2018 16:41:34 +0200 Subject: [PATCH 89/95] Code style adjustments --- .../Observer/CategoryProcessUrlRewriteMovingObserverTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php index d9b0c14b2a342..7e51731cf0776 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php @@ -73,7 +73,8 @@ protected function setUp() $this->urlPersistMock = $this->createMock(UrlPersistInterface::class); $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); $this->urlRewriteHandlerMock = $this->createMock(UrlRewriteHandler::class); - $this->urlRewriteBunchReplacerMock = $this->createPartialMock(UrlRewriteBunchReplacer::class, + $this->urlRewriteBunchReplacerMock = $this->createPartialMock( + UrlRewriteBunchReplacer::class, ['doBunchReplace'] ); $this->databaseMapPoolMock = $this->createMock(DatabaseMapPool::class); From 36d1a95037a7ec97afae0c0a54aa56cc0b60a48c Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 11 Sep 2018 10:48:57 +0300 Subject: [PATCH 90/95] Small adjustments --- .../CategoryProcessUrlRewriteMovingObserverTest.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php index 7e51731cf0776..6c54b4d554243 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php @@ -20,14 +20,13 @@ use Magento\Framework\Event; use Magento\Framework\Event\Observer; use Magento\UrlRewrite\Model\UrlPersistInterface; -use PHPUnit\Framework\TestCase; /** * Class CategoryProcessUrlRewriteMovingObserverTest * * @covers \Magento\CatalogUrlRewrite\Observer\CategoryProcessUrlRewriteMovingObserver */ -class CategoryProcessUrlRewriteMovingObserverTest extends TestCase +class CategoryProcessUrlRewriteMovingObserverTest extends \PHPUnit\Framework\TestCase { /** * @var CategoryProcessUrlRewriteMovingObserver @@ -54,11 +53,6 @@ class CategoryProcessUrlRewriteMovingObserverTest extends TestCase */ private $urlRewriteHandlerMock; - /** - * @var UrlRewriteBunchReplacer|\PHPUnit_Framework_MockObject_MockObject - */ - private $urlRewriteBunchReplacerMock; - /** * @var DatabaseMapPool|\PHPUnit_Framework_MockObject_MockObject */ @@ -73,7 +67,8 @@ protected function setUp() $this->urlPersistMock = $this->createMock(UrlPersistInterface::class); $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); $this->urlRewriteHandlerMock = $this->createMock(UrlRewriteHandler::class); - $this->urlRewriteBunchReplacerMock = $this->createPartialMock( + /** @var UrlRewriteBunchReplacer|\PHPUnit_Framework_MockObject_MockObject $urlRewriteBunchReplacerMock */ + $urlRewriteBunchReplacerMock = $this->createPartialMock( UrlRewriteBunchReplacer::class, ['doBunchReplace'] ); @@ -84,7 +79,7 @@ protected function setUp() $this->urlPersistMock, $this->scopeConfigMock, $this->urlRewriteHandlerMock, - $this->urlRewriteBunchReplacerMock, + $urlRewriteBunchReplacerMock, $this->databaseMapPoolMock, [ DataCategoryUrlRewriteDatabaseMap::class, From a73393393d460c63f26a155417d7a62e466b9f4e Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 11 Sep 2018 13:42:35 +0300 Subject: [PATCH 91/95] Refactoring the local variable's name --- .../CategoryProcessUrlRewriteMovingObserverTest.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php index 6c54b4d554243..d22f0e212b75e 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php @@ -67,11 +67,8 @@ protected function setUp() $this->urlPersistMock = $this->createMock(UrlPersistInterface::class); $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); $this->urlRewriteHandlerMock = $this->createMock(UrlRewriteHandler::class); - /** @var UrlRewriteBunchReplacer|\PHPUnit_Framework_MockObject_MockObject $urlRewriteBunchReplacerMock */ - $urlRewriteBunchReplacerMock = $this->createPartialMock( - UrlRewriteBunchReplacer::class, - ['doBunchReplace'] - ); + /** @var UrlRewriteBunchReplacer|\PHPUnit_Framework_MockObject_MockObject $urlRewriteMock */ + $urlRewriteMock = $this->createMock(UrlRewriteBunchReplacer::class); $this->databaseMapPoolMock = $this->createMock(DatabaseMapPool::class); $this->observer = new CategoryProcessUrlRewriteMovingObserver( @@ -79,7 +76,7 @@ protected function setUp() $this->urlPersistMock, $this->scopeConfigMock, $this->urlRewriteHandlerMock, - $urlRewriteBunchReplacerMock, + $urlRewriteMock, $this->databaseMapPoolMock, [ DataCategoryUrlRewriteDatabaseMap::class, From fd2cb4c38273ef894670ddc6e59ea3afbeae52f2 Mon Sep 17 00:00:00 2001 From: Eugene Shakhsuvarov <ishakhsuvarov@magento.com> Date: Tue, 18 Sep 2018 12:47:17 +0300 Subject: [PATCH 92/95] Update CategoryProcessUrlRewriteMovingObserverTest.php Suppress PHPMD warning for test --- .../Observer/CategoryProcessUrlRewriteMovingObserverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php index d22f0e212b75e..b12da6243a903 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteMovingObserverTest.php @@ -24,7 +24,7 @@ /** * Class CategoryProcessUrlRewriteMovingObserverTest * - * @covers \Magento\CatalogUrlRewrite\Observer\CategoryProcessUrlRewriteMovingObserver + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CategoryProcessUrlRewriteMovingObserverTest extends \PHPUnit\Framework\TestCase { From 16a59db24c9de646a30d7c73ccba409778494c39 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Sun, 23 Sep 2018 10:33:00 -0500 Subject: [PATCH 93/95] MSI-1650: Fix CE integration test. - add to CPD blacklist --- .../Magento/Test/Php/_files/phpcpd/blacklist/common.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt index fd8c09907e0ed..8fa70be004fa9 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt @@ -202,3 +202,6 @@ setup/performance-toolkit/aggregate-report Magento/MessageQueue/Setup Magento/Elasticsearch/Elasticsearch5 Test/_files +Magento/InventoryCatalogAdminUi/Controller/Adminhtml +Magento/InventoryConfigurableProductIndexer/Indexer +Magento/InventoryGroupedProductIndexer/Indexer From cf81fdc6a4eab03495726f280a9067e2b23cc2c5 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda <vnayda@magento.com> Date: Mon, 24 Sep 2018 21:10:12 +0300 Subject: [PATCH 94/95] GraphQL-88: 'small_image' in 'ProductInterface' does not have enough info --- .../Model/Resolver/Product/Image.php | 30 +++++++++---------- .../GraphQl/Catalog/MediaGalleryTest.php | 6 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php index b7ded290f981f..49617c442eebd 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Image.php @@ -7,10 +7,9 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; -use Magento\Catalog\Helper\ImageFactory as CatalogImageHelperFactory; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\ImageFactory; use Magento\Framework\GraphQl\Config\Element\Field; -use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; @@ -20,17 +19,19 @@ class Image implements ResolverInterface { /** - * @var CatalogImageHelperFactory + * Product image factory + * + * @var ImageFactory */ - private $catalogImageHelperFactory; + private $productImageFactory; /** - * @param CatalogImageHelperFactory $catalogImageHelperFactory + * @param ImageFactory $productImageFactory */ public function __construct( - CatalogImageHelperFactory $catalogImageHelperFactory + ImageFactory $productImageFactory ) { - $this->catalogImageHelperFactory = $catalogImageHelperFactory; + $this->productImageFactory = $productImageFactory; } /** @@ -44,22 +45,21 @@ public function resolve( array $args = null ): array { if (!isset($value['model'])) { - throw new GraphQlInputException(__('"model" value should be specified')); + throw new \LogicException(__('"model" value should be specified')); } /** @var Product $product */ $product = $value['model']; $imageType = $field->getName(); + $path = $product->getData($imageType); - $catalogImageHelper = $this->catalogImageHelperFactory->create(); - $imageUrl = $catalogImageHelper->init( - $product, - 'product_' . $imageType, - ['type' => $imageType] - )->getUrl(); + $image = $this->productImageFactory->create(); + $image->setDestinationSubdir($imageType) + ->setBaseFile($path); + $imageUrl = $image->getUrl(); return [ 'url' => $imageUrl, - 'path' => $product->getData($imageType) + 'path' => $path, ]; } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index 4fe31fd400d3f..8da2702917af0 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -31,9 +31,9 @@ public function testProductSmallImageUrlWithExistingImage() { products(filter: {sku: {eq: "{$productSku}"}}) { items { - small_image { - url - } + small_image { + url + } } } } From ac48c86bc7374ff99fb8e1ba6c7c75ac414084c7 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@magento.com> Date: Tue, 25 Sep 2018 11:43:13 +0300 Subject: [PATCH 95/95] magento-engcom/magento2ce#2203: Fixed tests failures --- .../Analytics/ReportXml/DB/SelectBuilder.php | 1 + .../Model/Entity/Attribute/OptionManagement.php | 15 ++++++++++++--- .../Entity/Attribute/OptionManagementTest.php | 14 +++++++------- app/code/Magento/Paypal/Model/AbstractConfig.php | 4 ++-- app/code/Magento/Paypal/Model/Config.php | 12 ++++++++++++ 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php b/app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php index f61e02988103a..b4b7adebf7459 100644 --- a/app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php +++ b/app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php @@ -11,6 +11,7 @@ /** * Responsible for Select object creation, works as a builder. Returns Select as result; + * * Used in SQL assemblers. */ class SelectBuilder diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php b/app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php index 8cb8687cd1f1f..4e4e146208a47 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php @@ -10,6 +10,9 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Exception\StateException; +/** + * Eav Option Management + */ class OptionManagement implements \Magento\Eav\Api\AttributeOptionManagementInterface { /** @@ -36,7 +39,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function add($entityType, $attributeCode, $option) { @@ -79,7 +82,7 @@ public function add($entityType, $attributeCode, $option) } /** - * {@inheritdoc} + * @inheritdoc */ public function delete($entityType, $attributeCode, $optionId) { @@ -110,7 +113,7 @@ public function delete($entityType, $attributeCode, $optionId) } /** - * {@inheritdoc} + * @inheritdoc */ public function getItems($entityType, $attributeCode) { @@ -129,6 +132,8 @@ public function getItems($entityType, $attributeCode) } /** + * Validate option + * * @param \Magento\Eav\Api\Data\AttributeInterface $attribute * @param int $optionId * @throws NoSuchEntityException @@ -148,6 +153,8 @@ protected function validateOption($attribute, $optionId) } /** + * Returns option id + * * @param \Magento\Eav\Api\Data\AttributeOptionInterface $option * @return string */ @@ -157,6 +164,8 @@ private function getOptionId(\Magento\Eav\Api\Data\AttributeOptionInterface $opt } /** + * Set option value + * * @param \Magento\Eav\Api\Data\AttributeOptionInterface $option * @param \Magento\Eav\Api\Data\AttributeInterface $attribute * @param string $optionLabel diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/OptionManagementTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/OptionManagementTest.php index 2ae31a05d957f..b63a4dd2c9ae6 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/OptionManagementTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/OptionManagementTest.php @@ -59,13 +59,13 @@ public function testAdd() $labelMock = $this->createMock(\Magento\Eav\Api\Data\AttributeOptionLabelInterface::class); $option = ['value' => [ - 'new_option' => [ + 'id_new_option' => [ 0 => 'optionLabel', 42 => 'labelLabel', ], ], 'order' => [ - 'new_option' => 'optionSortOrder', + 'id_new_option' => 'optionSortOrder', ], ]; @@ -78,10 +78,10 @@ public function testAdd() $labelMock->expects($this->once())->method('getStoreId')->willReturn(42); $labelMock->expects($this->once())->method('getLabel')->willReturn('labelLabel'); $optionMock->expects($this->once())->method('getIsDefault')->willReturn(true); - $attributeMock->expects($this->once())->method('setDefault')->with(['new_option']); + $attributeMock->expects($this->once())->method('setDefault')->with(['id_new_option']); $attributeMock->expects($this->once())->method('setOption')->with($option); $this->resourceModelMock->expects($this->once())->method('save')->with($attributeMock); - $this->assertEquals('new_option', $this->model->add($entityType, $attributeCode, $optionMock)); + $this->assertEquals('id_new_option', $this->model->add($entityType, $attributeCode, $optionMock)); } /** @@ -167,13 +167,13 @@ public function testAddWithCannotSaveException() $labelMock = $this->createMock(\Magento\Eav\Api\Data\AttributeOptionLabelInterface::class); $option = ['value' => [ - 'new_option' => [ + 'id_new_option' => [ 0 => 'optionLabel', 42 => 'labelLabel', ], ], 'order' => [ - 'new_option' => 'optionSortOrder', + 'id_new_option' => 'optionSortOrder', ], ]; @@ -186,7 +186,7 @@ public function testAddWithCannotSaveException() $labelMock->expects($this->once())->method('getStoreId')->willReturn(42); $labelMock->expects($this->once())->method('getLabel')->willReturn('labelLabel'); $optionMock->expects($this->once())->method('getIsDefault')->willReturn(true); - $attributeMock->expects($this->once())->method('setDefault')->with(['new_option']); + $attributeMock->expects($this->once())->method('setDefault')->with(['id_new_option']); $attributeMock->expects($this->once())->method('setOption')->with($option); $this->resourceModelMock->expects($this->once())->method('save')->with($attributeMock) ->willThrowException(new \Exception()); diff --git a/app/code/Magento/Paypal/Model/AbstractConfig.php b/app/code/Magento/Paypal/Model/AbstractConfig.php index 8d002a670a435..e5beddac3b189 100644 --- a/app/code/Magento/Paypal/Model/AbstractConfig.php +++ b/app/code/Magento/Paypal/Model/AbstractConfig.php @@ -134,7 +134,7 @@ public function setStoreId($storeId) * Returns payment configuration value * * @param string $key - * @param null $storeId + * @param null|int $storeId * @return null|string * * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -254,7 +254,7 @@ public function isWppApiAvailable() /** * Check whether method available for checkout or not * - * @param null $methodCode + * @param null|string $methodCode * * @return bool */ diff --git a/app/code/Magento/Paypal/Model/Config.php b/app/code/Magento/Paypal/Model/Config.php index c16b3025e382a..b058ba129a33f 100644 --- a/app/code/Magento/Paypal/Model/Config.php +++ b/app/code/Magento/Paypal/Model/Config.php @@ -10,6 +10,7 @@ /** * Config model that is aware of all \Magento\Paypal payment methods + * * Works with PayPal-specific system configuration * @SuppressWarnings(PHPMD.ExcessivePublicCount) @@ -632,6 +633,7 @@ public function __construct( /** * Check whether method available for checkout or not + * * Logic based on merchant country, methods dependence * * @param string|null $methodCode @@ -723,6 +725,7 @@ public function getMerchantCountry() /** * Check whether method supported for specified country or not + * * Use $_methodCode and merchant country by default * * @param string|null $method @@ -896,6 +899,7 @@ public function getExpressCheckoutEditUrl($token) /** * Get url for additional actions that PayPal may require customer to do after placing the order. + * * For instance, redirecting customer to bank for payment confirmation. * * @param string $token @@ -957,6 +961,7 @@ public function areButtonsDynamic() /** * Express checkout shortcut pic URL getter + * * PayPal will ignore "pal", if there is no total amount specified * * @param string $localeCode @@ -996,6 +1001,7 @@ public function getExpressCheckoutInContextImageUrl($localeCode) /** * Get PayPal "mark" image URL + * * Supposed to be used on payment methods selection * $staticSize is applicable for static images only * @@ -1032,6 +1038,7 @@ public function getPaymentMarkImageUrl($localeCode, $orderTotal = null, $pal = n /** * Get "What Is PayPal" localized URL + * * Supposed to be used with "mark" as popup window * * @param \Magento\Framework\Locale\ResolverInterface $localeResolver @@ -1262,6 +1269,7 @@ public function getExpressCheckoutBASignupOptions() /** * Whether to ask customer to create billing agreements + * * Unilateral payments are incompatible with the billing agreements * * @return bool @@ -1376,6 +1384,7 @@ public function exportExpressCheckoutStyleSettings(\Magento\Framework\DataObject /** * Dynamic PayPal image URL getter + * * Also can render dynamic Acceptance Mark * * @param string $type @@ -1725,6 +1734,7 @@ public function getBmlPublisherId() /** * Get Display option from stored config + * * @param string $section * * @return mixed @@ -1752,6 +1762,7 @@ public function getBmlDisplay($section) /** * Get Position option from stored config + * * @param string $section * * @return mixed @@ -1767,6 +1778,7 @@ public function getBmlPosition($section) /** * Get Size option from stored config + * * @param string $section * * @return mixed