Skip to content

Commit 463a183

Browse files
author
Yauhen_Lyskavets
committed
MAGETWO-91768: Customer section not updated after subscription declined
- Fix added
1 parent ed8b676 commit 463a183

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/code/Magento/Newsletter/Controller/Subscriber/Unsubscribe.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
class Unsubscribe extends \Magento\Newsletter\Controller\Subscriber
1010
{
1111
/**
12-
* Unsubscribe newsletter
13-
* @return void
12+
* Unsubscribe newsletter.
13+
*
14+
* @return \Magento\Backend\Model\View\Result\Redirect
1415
*/
1516
public function execute()
1617
{
@@ -27,6 +28,9 @@ public function execute()
2728
$this->messageManager->addException($e, __('Something went wrong while unsubscribing you.'));
2829
}
2930
}
30-
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
31+
/** @var \Magento\Backend\Model\View\Result\Redirect $redirect */
32+
$redirect = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT);
33+
$redirectUrl = $this->_redirect->getRedirectUrl();
34+
return $redirect->setUrl($redirectUrl);
3135
}
3236
}

0 commit comments

Comments
 (0)