In magento EE 1.13, reset forgot password page not showing any error messages after apply patch 6788.Here is my resetPasswordPostAction() where error messages are adding to session and redirects to changeForgotten action
if (!empty($errorMessages)) {
$this->_getSession()
->setCustomerFormData($this->getRequest()->getPost());
foreach ($errorMessages as $errorMessage) {
$this->_getSession()->addError($errorMessage);
}
$this->_redirect('*/*/changeforgotten');
return $this;
}
and in resetforgottenpassword.phtml it showing error messages like
<?php echo $this->getMessagesBlock()->getGroupedHtml(); ?>
core changeForgottenAction is :
public function changeForgottenAction()
{
try {
list($customerId, $resetPasswordLinkToken) = $this->_getRestorePasswordParameters($this->_getSession());
$this->_validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken);
$this->loadLayout();
$this->renderLayout();
} catch (Exception $exception) {
$this->_getSession()->addError($this->_getHelper('customer')->__('Your password reset link has expired.'));
$this->_redirect('*/*/forgotpassword');
}
}
after digging into core files observed that changeForgottenAction() not initialized the layout message.use below code after $this->loadLayout();
$this->_initLayoutMessages('customer/session');
final changeForgottenAction() action would be :
public function changeForgottenAction()
{
try {
list($customerId, $resetPasswordLinkToken) = $this->_getRestorePasswordParameters($this->_getSession());
$this->_validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken);
$this->loadLayout();
$this->_initLayoutMessages('customer/session');
$this->renderLayout();
} catch (Exception $exception) {
$this->_getSession()->addError($this->_getHelper('customer')->__('Your password reset link has expired.'));
$this->_redirect('*/*/forgotpassword');
}
}
THANKS!!