Skip to content

Commit c817ebc

Browse files
author
Korshenko, Oleksii(okorshenko)
committed
Merge pull request #642 from magento-ogre/PR_Branch
[Ogres] Bug Fixes
2 parents 42428d5 + ddd6aa8 commit c817ebc

File tree

66 files changed

+1649
-2052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1649
-2052
lines changed

app/code/Magento/Catalog/Console/Command/ImagesResizeCommand.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\Catalog\Console\Command;
77

8-
use Magento\Catalog\Api\ProductRepositoryInterface;
98
use Magento\Catalog\Model\Product;
109
use Magento\Catalog\Model\Product\Image\Cache as ImageCache;
1110
use Magento\Catalog\Model\Product\Image\CacheFactory as ImageCacheFactory;
@@ -30,7 +29,7 @@ class ImagesResizeCommand extends Command
3029
protected $productCollectionFactory;
3130

3231
/**
33-
* @var ProductRepositoryInterface
32+
* @var \Magento\Catalog\Api\ProductRepositoryInterface
3433
*/
3534
protected $productRepository;
3635

@@ -42,13 +41,13 @@ class ImagesResizeCommand extends Command
4241
/**
4342
* @param AppState $appState
4443
* @param ProductCollectionFactory $productCollectionFactory
45-
* @param ProductRepositoryInterface $productRepository
44+
* @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
4645
* @param ImageCacheFactory $imageCacheFactory
4746
*/
4847
public function __construct(
4948
AppState $appState,
5049
ProductCollectionFactory $productCollectionFactory,
51-
ProductRepositoryInterface $productRepository,
50+
\Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
5251
ImageCacheFactory $imageCacheFactory
5352
) {
5453
$this->appState = $appState;
@@ -79,7 +78,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
7978
$productIds = $productCollection->getAllIds();
8079
if (!count($productIds)) {
8180
$output->writeln("<info>No product images to resize</info>");
82-
return;
81+
// we must have an exit code higher than zero to indicate something was wrong
82+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
8383
}
8484

8585
try {
@@ -99,7 +99,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
9999
}
100100
} catch (\Exception $e) {
101101
$output->writeln("<error>{$e->getMessage()}</error>");
102-
return;
102+
// we must have an exit code higher than zero to indicate something was wrong
103+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
103104
}
104105

105106
$output->write("\n");

app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
118118
'Magento\Deploy\Model\Deployer',
119119
['filesUtil' => $filesUtil, 'output' => $output, 'isDryRun' => $options[self::DRY_RUN_OPTION]]
120120
);
121-
$deployer->deploy($this->objectManagerFactory, $languages);
121+
return $deployer->deploy($this->objectManagerFactory, $languages);
122122
}
123123
}

app/code/Magento/Deploy/Console/Command/SetModeCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
109109
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
110110
$output->writeln($e->getTraceAsString());
111111
}
112-
return;
112+
// we must have an exit code higher than zero to indicate something was wrong
113+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
113114
}
114115
}
115116
}

app/code/Magento/Deploy/Model/Deployer.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function (AlternativeSourceInterface $alternative) {
112112
*
113113
* @param ObjectManagerFactory $omFactory
114114
* @param array $locales
115-
* @return void
115+
* @return int
116116
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
117117
* @SuppressWarnings(PHPMD.NPathComplexity)
118118
*/
@@ -134,7 +134,6 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales)
134134
$this->output->writeln("=== {$area} -> {$themePath} -> {$locale} ===");
135135
$this->count = 0;
136136
$this->errorCount = 0;
137-
138137
/** @var \Magento\Theme\Model\View\Design $design */
139138
$design = $this->objectManager->create('Magento\Theme\Model\View\Design');
140139
$design->setDesignTheme($themePath, $area);
@@ -159,7 +158,6 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales)
159158
]
160159
);
161160
$fileManager->createRequireJsConfigAsset();
162-
163161
foreach ($appFiles as $info) {
164162
list($fileArea, $fileTheme, , $module, $filePath) = $info;
165163
if (($fileArea == $area || $fileArea == 'base') &&
@@ -182,13 +180,8 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales)
182180
}
183181
}
184182
if ($this->jsTranslationConfig->dictionaryEnabled()) {
185-
$this->deployFile(
186-
$this->jsTranslationConfig->getDictionaryFileName(),
187-
$area,
188-
$themePath,
189-
$locale,
190-
null
191-
);
183+
$dictionaryFileName = $this->jsTranslationConfig->getDictionaryFileName();
184+
$this->deployFile($dictionaryFileName, $area, $themePath, $locale, null);
192185
}
193186
$fileManager->clearBundleJsPool();
194187
$this->bundleManager->flush();
@@ -213,6 +206,11 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales)
213206
if (!$this->isDryRun) {
214207
$this->versionStorage->save($version);
215208
}
209+
if ($this->errorCount > 0) {
210+
// we must have an exit code higher than zero to indicate something was wrong
211+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
212+
}
213+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
216214
}
217215

218216
/**

app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101
foreach ($failures as $message) {
102102
$output->writeln(' - ' . $message);
103103
}
104+
// we must have an exit code higher than zero to indicate something was wrong
105+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
104106
} else {
105107
$output->writeln('PASSED (' . count($runCommands) . ')');
106108
}
107-
return 0;
109+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
108110
}
109111

110112
/**

app/code/Magento/Developer/Console/Command/XmlConverterCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
129129
$output->write($result);
130130
}
131131

132-
return;
132+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
133133
} catch (\Exception $exception) {
134134
$errorMessage = $exception->getMessage();
135135
$output->writeln("<error>$errorMessage</error>");
136-
return;
136+
// we must have an exit code higher than zero to indicate something was wrong
137+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
137138
}
138139
}
139140
}

app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ protected function configure()
4444
protected function execute(InputInterface $input, OutputInterface $output)
4545
{
4646
$indexers = $this->getIndexers($input);
47+
$returnValue = \Magento\Framework\Console\Cli::RETURN_SUCCESS;
4748
foreach ($indexers as $indexer) {
4849
try {
4950
$this->validateIndexerStatus($indexer);
@@ -64,11 +65,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
6465
);
6566
} catch (LocalizedException $e) {
6667
$output->writeln($e->getMessage());
68+
// we must have an exit code higher than zero to indicate something was wrong
69+
$returnValue = \Magento\Framework\Console\Cli::RETURN_FAILURE;
6770
} catch (\Exception $e) {
6871
$output->writeln($indexer->getTitle() . ' indexer process unknown error:');
6972
$output->writeln($e->getMessage());
73+
// we must have an exit code higher than zero to indicate something was wrong
74+
$returnValue = \Magento\Framework\Console\Cli::RETURN_FAILURE;
7075
}
7176
}
77+
return $returnValue;
7278
}
7379

7480
/**

app/code/Magento/Indexer/Console/Command/IndexerSetModeCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
4848

4949
$indexers = $this->getIndexers($input);
5050

51+
$returnValue = \Magento\Framework\Console\Cli::RETURN_SUCCESS;
5152
foreach ($indexers as $indexer) {
5253
try {
5354
$previousStatus = $indexer->isScheduled() ? 'Update by Schedule' : 'Update on Save';
@@ -63,13 +64,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
6364
}
6465
} catch (LocalizedException $e) {
6566
$output->writeln($e->getMessage() . PHP_EOL);
67+
// we must have an exit code higher than zero to indicate something was wrong
68+
$returnValue = \Magento\Framework\Console\Cli::RETURN_FAILURE;
6669
} catch (\Exception $e) {
6770
$output->writeln($indexer->getTitle() . " indexer process unknown error:" . PHP_EOL);
6871
$output->writeln($e->getMessage() . PHP_EOL);
72+
// we must have an exit code higher than zero to indicate something was wrong
73+
$returnValue = \Magento\Framework\Console\Cli::RETURN_FAILURE;
6974
}
7075
}
7176

72-
return $this;
77+
return $returnValue;
7378
}
7479

7580
/**

app/code/Magento/Theme/Console/Command/ThemeUninstallCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
196196
$messages = array_merge($messages, $this->validate($themePaths));
197197
if (!empty($messages)) {
198198
$output->writeln($messages);
199-
return;
199+
// we must have an exit code higher than zero to indicate something was wrong
200+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
200201
}
201202
$messages = array_merge(
202203
$messages,
@@ -209,7 +210,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
209210
'<error>Unable to uninstall. Please resolve the following issues:</error>'
210211
. PHP_EOL . implode(PHP_EOL, $messages)
211212
);
212-
return;
213+
// we must have an exit code higher than zero to indicate something was wrong
214+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
213215
}
214216

215217
try {
@@ -230,6 +232,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
230232
} catch (\Exception $e) {
231233
$output->writeln('<error>' . $e->getMessage() . '</error>');
232234
$output->writeln('<error>Please disable maintenance mode after you resolved above issues</error>');
235+
// we must have an exit code higher than zero to indicate something was wrong
236+
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
233237
}
234238
}
235239

bin/magento

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ try {
2828
echo "\n\n";
2929
$e = $e->getPrevious();
3030
}
31+
exit(Cli::RETURN_FAILURE);
3132
}

dev/tests/integration/testsuite/Magento/Setup/Model/UpdatePackagesCacheTest.php

Lines changed: 0 additions & 114 deletions
This file was deleted.

dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ protected function pluginDataProvider()
393393
*/
394394
public function testCompiler()
395395
{
396+
$this->markTestSkipped('MAGETWO-52570');
396397
try {
397398
$this->_shell->execute($this->_command);
398399
} catch (\Magento\Framework\Exception\LocalizedException $exception) {

0 commit comments

Comments
 (0)