Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public function execute()
$ruleJob->applyAll();

if ($ruleJob->hasSuccess()) {
$this->messageManager->addSuccess($ruleJob->getSuccess());
$this->messageManager->addSuccessMessage($ruleJob->getSuccess());
$this->_objectManager->create(\Magento\CatalogRule\Model\Flag::class)->loadSelf()->setState(0)->save();
} elseif ($ruleJob->hasError()) {
$this->messageManager->addError($errorMessage . ' ' . $ruleJob->getError());
$this->messageManager->addErrorMessage($errorMessage . ' ' . $ruleJob->getError());
}
} catch (\Exception $e) {
$this->_objectManager->create(\Psr\Log\LoggerInterface::class)->critical($e);
$this->messageManager->addError($errorMessage);
$this->messageManager->addErrorMessage($errorMessage);
}

/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ public function execute()
$ruleRepository->deleteById($id);

$this->_objectManager->create(\Magento\CatalogRule\Model\Flag::class)->loadSelf()->setState(1)->save();
$this->messageManager->addSuccess(__('You deleted the rule.'));
$this->messageManager->addSuccessMessage(__('You deleted the rule.'));
$this->_redirect('catalog_rule/*/');
return;
} catch (LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addError(
$this->messageManager->addErrorMessage(
__('We can\'t delete this rule right now. Please review the log and try again.')
);
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
$this->_redirect('catalog_rule/*/edit', ['id' => $this->getRequest()->getParam('id')]);
return;
}
}
$this->messageManager->addError(__('We can\'t find a rule to delete.'));
$this->messageManager->addErrorMessage(__('We can\'t find a rule to delete.'));
$this->_redirect('catalog_rule/*/');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function execute()
try {
$model = $ruleRepository->get($id);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
$this->messageManager->addError(__('This rule no longer exists.'));
$this->messageManager->addErrorMessage(__('This rule no longer exists.'));
$this->_redirect('catalog_rule/*');
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function execute()
$validateResult = $model->validateData(new \Magento\Framework\DataObject($data));
if ($validateResult !== true) {
foreach ($validateResult as $errorMessage) {
$this->messageManager->addError($errorMessage);
$this->messageManager->addErrorMessage($errorMessage);
}
$this->_getSession()->setPageData($data);
$this->dataPersistor->set('catalog_rule', $data);
Expand All @@ -88,7 +88,7 @@ public function execute()

$ruleRepository->save($model);

$this->messageManager->addSuccess(__('You saved the rule.'));
$this->messageManager->addSuccessMessage(__('You saved the rule.'));
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setPageData(false);
$this->dataPersistor->clear('catalog_rule');

Expand All @@ -111,9 +111,9 @@ public function execute()
}
return;
} catch (LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addError(
$this->messageManager->addErrorMessage(
__('Something went wrong while saving the rule data. Please review the error log.')
);
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function checkCatalogRulesAvailability($attributeCode)

if ($disabledRulesCount) {
$this->ruleProductProcessor->markIndexerAsInvalid();
$this->messageManager->addWarning(
$this->messageManager->addWarningMessage(
__(
'You disabled %1 Catalog Price Rules based on "%2" attribute.',
$disabledRulesCount,
Expand Down