Skip to content

Commit a9ea087

Browse files
author
Joan He
authored
Merge pull request #4474 from magento-thunder/MC-17992
[thunder] MC-17992: [Backport] Error during app:config:import isn't logged during setup:upgrade
2 parents f7c5741 + 2df6d56 commit a9ea087

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

setup/src/Magento/Setup/Console/Command/UpgradeCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ protected function configure()
8787
protected function execute(InputInterface $input, OutputInterface $output)
8888
{
8989
try {
90+
$resultCode = \Magento\Framework\Console\Cli::RETURN_SUCCESS;
9091
$keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED);
9192
$installer = $this->installerFactory->create(new ConsoleLogger($output));
9293
$installer->updateModulesSequence($keepGenerated);
@@ -97,10 +98,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
9798
$importConfigCommand = $this->getApplication()->find(ConfigImportCommand::COMMAND_NAME);
9899
$arrayInput = new ArrayInput([]);
99100
$arrayInput->setInteractive($input->isInteractive());
100-
$importConfigCommand->run($arrayInput, $output);
101+
$resultCode = $importConfigCommand->run($arrayInput, $output);
101102
}
102103

103-
if (!$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) {
104+
if ($resultCode !== \Magento\Framework\Console\Cli::RETURN_FAILURE
105+
&& !$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) {
104106
$output->writeln(
105107
'<info>Please re-run Magento compile command. Use the command "setup:di:compile"</info>'
106108
);
@@ -110,6 +112,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
110112
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
111113
}
112114

113-
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
115+
return $resultCode;
114116
}
115117
}

0 commit comments

Comments
 (0)