Skip to content

magento/magento2#: Replace deprecated addError, addSuccess, addException methods in Magento/Customer/Controller/Account/Confirmation.php #24284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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
21 changes: 13 additions & 8 deletions app/code/Magento/Customer/Controller/Account/Confirmation.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Customer\Controller\Account;

use Magento\Customer\Api\AccountManagementInterface;
use Magento\Customer\Controller\AbstractAccount;
use Magento\Customer\Model\Session;
use Magento\Customer\Model\Url;
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
use Magento\Framework\App\Action\HttpPosttActionInterface as HttpPostActionInterface;
use Magento\Framework\App\Action\Context;
use Magento\Customer\Model\Session;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Exception\State\InvalidTransitionException;
use Magento\Framework\View\Result\PageFactory;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Customer\Api\AccountManagementInterface;
use Magento\Framework\Exception\State\InvalidTransitionException;

class Confirmation extends \Magento\Customer\Controller\AbstractAccount
/**
* Class Confirmation. Send confirmation link to specified email
*/
class Confirmation extends AbstractAccount implements HttpGetActionInterface, HttpPostActionInterface
{
/**
* @var \Magento\Store\Model\StoreManagerInterface
Expand Down Expand Up @@ -91,11 +96,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