Skip to content

Commit 269a880

Browse files
committed
MAGE-1201 Check CLI context for warnings
1 parent 31098d6 commit 269a880

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Observer/RecommendSettings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ protected function handleRecommendApiException(\Exception $e, string $modelName,
207207
}
208208

209209
$msg = __(
210-
"The following error was encountered while enabling %1 recommendations: %2",
210+
"Error encountered while enabling %1 recommendations: %2",
211211
$modelName,
212212
$msg
213213
);
@@ -237,8 +237,8 @@ protected function rollBack(string $changedPath, \Magento\Framework\Phrase $mess
237237
*/
238238
protected function shouldDisplayWarning(): bool
239239
{
240-
return $this->appState->getAreaCode() === \Magento\Framework\App\Area::AREA_ADMINHTML;
241-
240+
return $this->appState->getAreaCode() === \Magento\Framework\App\Area::AREA_ADMINHTML
241+
&& php_sapi_name() !== 'cli';
242242
}
243243

244244
/**

0 commit comments

Comments
 (0)