Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 3 additions & 3 deletions app/code/Magento/Customer/Controller/Account/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ public function execute()
$metadata->setPath('/');
$this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
}
$this->messageManager->addSuccess($this->getSuccessMessage());
$this->messageManager->addSuccessMessage($this->getSuccessMessage());
$resultRedirect->setUrl($this->getSuccessRedirect());
return $resultRedirect;
} catch (StateException $e) {
$this->messageManager->addException($e, __('This confirmation key is invalid or has expired.'));
$this->messageManager->addExceptionMessage($e, __('This confirmation key is invalid or has expired.'));
} catch (\Exception $e) {
$this->messageManager->addException($e, __('There was an error confirming the account'));
$this->messageManager->addExceptionMessage($e, __('There was an error confirming the account'));
}

$url = $this->urlModel->getUrl('*/*/index', ['_secure' => true]);
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Customer/Controller/Account/Confirmation.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ public function execute()
$email,
$this->storeManager->getStore()->getWebsiteId()
);
$this->messageManager->addSuccess(__('Please check your email for confirmation key.'));
$this->messageManager->addSuccessMessage(__('Please check your email for confirmation key.'));
} catch (InvalidTransitionException $e) {
$this->messageManager->addSuccess(__('This email does not require confirmation.'));
$this->messageManager->addSuccessMessage(__('This email does not require confirmation.'));
} catch (\Exception $e) {
$this->messageManager->addException($e, __('Wrong email.'));
$this->messageManager->addExceptionMessage($e, __('Wrong email.'));
$resultRedirect->setPath('*/*/*', ['email' => $email, '_secure' => true]);
return $resultRedirect;
}
Expand Down
14 changes: 7 additions & 7 deletions app/code/Magento/Customer/Controller/Account/CreatePost.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function execute()
if ($confirmationStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) {
$email = $this->customerUrl->getEmailConfirmationUrl($customer->getEmail());
// @codingStandardsIgnoreStart
$this->messageManager->addSuccess(
$this->messageManager->addSuccessMessage(
__(
'You must confirm your account. Please check your email for the confirmation link or <a href="%1">click here</a> for a new link.',
$email
Expand All @@ -377,7 +377,7 @@ public function execute()
$resultRedirect->setUrl($this->_redirect->success($url));
} else {
$this->session->setCustomerDataAsLoggedIn($customer);
$this->messageManager->addSuccess($this->getSuccessMessage());
$this->messageManager->addSuccessMessage($this->getSuccessMessage());
$requestedRedirect = $this->accountRedirect->getRedirectCookie();
if (!$this->scopeConfig->getValue('customer/startup/redirect_dashboard') && $requestedRedirect) {
$resultRedirect->setUrl($this->_redirect->success($requestedRedirect));
Expand All @@ -401,16 +401,16 @@ public function execute()
$url
);
// @codingStandardsIgnoreEnd
$this->messageManager->addError($message);
$this->messageManager->addErrorMessage($message);
} catch (InputException $e) {
$this->messageManager->addError($this->escaper->escapeHtml($e->getMessage()));
$this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage()));
foreach ($e->getErrors() as $error) {
$this->messageManager->addError($this->escaper->escapeHtml($error->getMessage()));
$this->messageManager->addErrorMessage($this->escaper->escapeHtml($error->getMessage()));
}
} catch (LocalizedException $e) {
$this->messageManager->addError($this->escaper->escapeHtml($e->getMessage()));
$this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage()));
} catch (\Exception $e) {
$this->messageManager->addException($e, __('We can\'t save the customer.'));
$this->messageManager->addExceptionMessage($e, __('We can\'t save the customer.'));
}

$this->session->setCustomerFormData($this->getRequest()->getPostValue());
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Customer/Controller/Account/EditPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function execute()
$isPasswordChanged
);
$this->dispatchSuccessEvent($customerCandidateDataObject);
$this->messageManager->addSuccess(__('You saved the account information.'));
$this->messageManager->addSuccessMessage(__('You saved the account information.'));
return $resultRedirect->setPath('customer/account');
} catch (InvalidEmailOrPasswordException $e) {
$this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage()));
Expand All @@ -227,17 +227,17 @@ public function execute()
);
$this->session->logout();
$this->session->start();
$this->messageManager->addError($message);
$this->messageManager->addErrorMessage($message);
return $resultRedirect->setPath('customer/account/login');
} catch (InputException $e) {
$this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage()));
foreach ($e->getErrors() as $error) {
$this->messageManager->addErrorMessage($this->escaper->escapeHtml($error->getMessage()));
}
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException($e, __('We can\'t save the customer.'));
$this->messageManager->addExceptionMessage($e, __('We can\'t save the customer.'));
}

$this->session->setCustomerFormData($this->getRequest()->getPostValue());
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Customer/Controller/Account/LoginPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ public function execute()
$message = $e->getMessage();
} catch (\Exception $e) {
// PA DSS violation: throwing or logging an exception here can disclose customer password
$this->messageManager->addError(
$this->messageManager->addErrorMessage(
__('An unspecified error occurred. Please contact us for assistance.')
);
} finally {
if (isset($message)) {
$this->messageManager->addError($message);
$this->messageManager->addErrorMessage($message);
$this->session->setUsername($login['username']);
}
}
} else {
$this->messageManager->addError(__('A login and a password are required.'));
$this->messageManager->addErrorMessage(__('A login and a password are required.'));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ public function execute()
$passwordConfirmation = (string)$this->getRequest()->getPost('password_confirmation');

if ($password !== $passwordConfirmation) {
$this->messageManager->addError(__("New Password and Confirm New Password values didn't match."));
$this->messageManager->addErrorMessage(__("New Password and Confirm New Password values didn't match."));
$resultRedirect->setPath('*/*/createPassword', ['token' => $resetPasswordToken]);

return $resultRedirect;
}
if (iconv_strlen($password) <= 0) {
$this->messageManager->addError(__('Please enter a new password.'));
$this->messageManager->addErrorMessage(__('Please enter a new password.'));
$resultRedirect->setPath('*/*/createPassword', ['token' => $resetPasswordToken]);

return $resultRedirect;
Expand All @@ -92,17 +92,17 @@ public function execute()
$password
);
$this->session->unsRpToken();
$this->messageManager->addSuccess(__('You updated your password.'));
$this->messageManager->addSuccessMessage(__('You updated your password.'));
$resultRedirect->setPath('*/*/login');

return $resultRedirect;
} catch (InputException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
foreach ($e->getErrors() as $error) {
$this->messageManager->addError($error->getMessage());
$this->messageManager->addErrorMessage($error->getMessage());
}
} catch (\Exception $exception) {
$this->messageManager->addError(__('Something went wrong while saving the new password.'));
$this->messageManager->addErrorMessage(__('Something went wrong while saving the new password.'));
}
$resultRedirect->setPath('*/*/createPassword', ['token' => $resetPasswordToken]);

Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Customer/Controller/Address/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public function execute()
$address = $this->_addressRepository->getById($addressId);
if ($address->getCustomerId() === $this->_getSession()->getCustomerId()) {
$this->_addressRepository->deleteById($addressId);
$this->messageManager->addSuccess(__('You deleted the address.'));
$this->messageManager->addSuccessMessage(__('You deleted the address.'));
} else {
$this->messageManager->addError(__('We can\'t delete the address right now.'));
$this->messageManager->addErrorMessage(__('We can\'t delete the address right now.'));
}
} catch (\Exception $other) {
$this->messageManager->addException($other, __('We can\'t delete the address right now.'));
$this->messageManager->addExceptionMessage($other, __('We can\'t delete the address right now.'));
}
}
return $this->resultRedirectFactory->create()->setPath('*/*/index');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ public function execute()
if ($customerId = $this->getRequest()->getParam('customer_id')) {
try {
$this->tokenService->revokeCustomerAccessToken($customerId);
$this->messageManager->addSuccess(__('You have revoked the customer\'s tokens.'));
$this->messageManager->addSuccessMessage(__('You have revoked the customer\'s tokens.'));
$resultRedirect->setPath('customer/index/edit', ['id' => $customerId, '_current' => true]);
} catch (\Exception $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
$resultRedirect->setPath('customer/index/edit', ['id' => $customerId, '_current' => true]);
}
} else {
$this->messageManager->addError(__('We can\'t find a customer to revoke.'));
$this->messageManager->addErrorMessage(__('We can\'t find a customer to revoke.'));
$resultRedirect->setPath('customer/index/index');
}
return $resultRedirect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public function execute()
if ($id) {
try {
$this->groupRepository->deleteById($id);
$this->messageManager->addSuccess(__('You deleted the customer group.'));
$this->messageManager->addSuccessMessage(__('You deleted the customer group.'));
} catch (NoSuchEntityException $e) {
$this->messageManager->addError(__('The customer group no longer exists.'));
$this->messageManager->addErrorMessage(__('The customer group no longer exists.'));
return $resultRedirect->setPath('customer/*/');
} catch (\Exception $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
return $resultRedirect->setPath('customer/group/edit', ['id' => $id]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public function execute()

$this->groupRepository->save($customerGroup);

$this->messageManager->addSuccess(__('You saved the customer group.'));
$this->messageManager->addSuccessMessage(__('You saved the customer group.'));
$resultRedirect->setPath('customer/group');
} catch (\Exception $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
if ($customerGroup != null) {
$this->storeCustomerGroupDataToSession(
$this->dataObjectProcessor->buildOutputDataArray(
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Customer/Controller/Adminhtml/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ protected function _addSessionErrorMessages($messages)
protected function actUponMultipleCustomers(callable $singleAction, $customerIds)
{
if (!is_array($customerIds)) {
$this->messageManager->addError(__('Please select customer(s).'));
$this->messageManager->addErrorMessage(__('Please select customer(s).'));
return 0;
}
$customersUpdated = 0;
Expand All @@ -320,7 +320,7 @@ protected function actUponMultipleCustomers(callable $singleAction, $customerIds
$singleAction($customerId);
$customersUpdated++;
} catch (\Exception $exception) {
$this->messageManager->addError($exception->getMessage());
$this->messageManager->addErrorMessage($exception->getMessage());
}
}
return $customersUpdated;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function execute()
$collection = $this->filter->getCollection($this->collectionFactory->create());
return $this->massAction($collection);
} catch (\Exception $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
return $resultRedirect->setPath($this->redirectUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ public function execute()
$formKeyIsValid = $this->_formKeyValidator->validate($this->getRequest());
$isPost = $this->getRequest()->isPost();
if (!$formKeyIsValid || !$isPost) {
$this->messageManager->addError(__('Customer could not be deleted.'));
$this->messageManager->addErrorMessage(__('Customer could not be deleted.'));
return $resultRedirect->setPath('customer/index');
}

$customerId = $this->initCurrentCustomer();
if (!empty($customerId)) {
try {
$this->_customerRepository->deleteById($customerId);
$this->messageManager->addSuccess(__('You deleted the customer.'));
$this->messageManager->addSuccessMessage(__('You deleted the customer.'));
} catch (\Exception $exception) {
$this->messageManager->addError($exception->getMessage());
$this->messageManager->addErrorMessage($exception->getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function execute()
//do nothing
}
} catch (NoSuchEntityException $e) {
$this->messageManager->addException($e, __('Something went wrong while editing the customer.'));
$this->messageManager->addExceptionMessage($e, __('Something went wrong while editing the customer.'));
$resultRedirect = $this->resultRedirectFactory->create();
$resultRedirect->setPath('customer/*/index');
return $resultRedirect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ protected function saveCustomer(CustomerInterface $customer)
$this->disableAddressValidation($customer);
$this->customerRepository->save($customer);
} catch (\Magento\Framework\Exception\InputException $e) {
$this->getMessageManager()->addError($this->getErrorWithCustomerId($e->getMessage()));
$this->getMessageManager()->addErrorMessage($this->getErrorWithCustomerId($e->getMessage()));
$this->logger->critical($e);
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->getMessageManager()->addError($this->getErrorWithCustomerId($e->getMessage()));
$this->getMessageManager()->addErrorMessage($this->getErrorWithCustomerId($e->getMessage()));
$this->logger->critical($e);
} catch (\Exception $e) {
$this->getMessageManager()->addError($this->getErrorWithCustomerId('We can\'t save the customer.'));
$this->getMessageManager()->addErrorMessage($this->getErrorWithCustomerId('We can\'t save the customer.'));
$this->logger->critical($e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function massAction(AbstractCollection $collection)
}

if ($customersUpdated) {
$this->messageManager->addSuccess(__('A total of %1 record(s) were updated.', $customersUpdated));
$this->messageManager->addSuccessMessage(__('A total of %1 record(s) were updated.', $customersUpdated));
}
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function massAction(AbstractCollection $collection)
}

if ($customersDeleted) {
$this->messageManager->addSuccess(__('A total of %1 record(s) were deleted.', $customersDeleted));
$this->messageManager->addSuccessMessage(__('A total of %1 record(s) were deleted.', $customersDeleted));
}
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function massAction(AbstractCollection $collection)
}

if ($customersUpdated) {
$this->messageManager->addSuccess(__('A total of %1 record(s) were updated.', $customersUpdated));
$this->messageManager->addSuccessMessage(__('A total of %1 record(s) were updated.', $customersUpdated));
}
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function massAction(AbstractCollection $collection)
}

if ($customersUpdated) {
$this->messageManager->addSuccess(__('A total of %1 record(s) were updated.', $customersUpdated));
$this->messageManager->addSuccessMessage(__('A total of %1 record(s) were updated.', $customersUpdated));
}
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
Expand Down
Loading