File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
app/code/Magento/Newsletter/Controller/Subscriber Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 11<?php
22/**
3- *
43 * Copyright © Magento, Inc. All rights reserved.
54 * See COPYING.txt for license details.
65 */
76namespace Magento \Newsletter \Controller \Subscriber ;
87
9- class Unsubscribe extends \Magento \Newsletter \Controller \Subscriber
8+ use Magento \Framework \App \Action \HttpGetActionInterface as HttpGetActionInterface ;
9+
10+ /**
11+ * Controller for unsubscribing customers.
12+ */
13+ class Unsubscribe extends \Magento \Newsletter \Controller \Subscriber implements HttpGetActionInterface
1014{
1115 /**
12- * Unsubscribe newsletter
13- * @return void
16+ * Unsubscribe newsletter.
17+ *
18+ * @return \Magento\Backend\Model\View\Result\Redirect
1419 */
1520 public function execute ()
1621 {
@@ -27,6 +32,9 @@ public function execute()
2732 $ this ->messageManager ->addException ($ e , __ ('Something went wrong while unsubscribing you. ' ));
2833 }
2934 }
30- $ this ->getResponse ()->setRedirect ($ this ->_redirect ->getRedirectUrl ());
35+ /** @var \Magento\Backend\Model\View\Result\Redirect $redirect */
36+ $ redirect = $ this ->resultFactory ->create (\Magento \Framework \Controller \ResultFactory::TYPE_REDIRECT );
37+ $ redirectUrl = $ this ->_redirect ->getRedirectUrl ();
38+ return $ redirect ->setUrl ($ redirectUrl );
3139 }
3240}
You can’t perform that action at this time.
0 commit comments