From 361965b1c874f096d0758782ed7539e53460dc19 Mon Sep 17 00:00:00 2001 From: Arjen Miedema Date: Wed, 12 Jun 2019 07:42:49 +0200 Subject: [PATCH] Fix the 404 message for product alerts when not logged in When the user isn't logged in and presses the product alert link (either stock or price), the user has to login and gets redirected to a 404 page. This is because the redirect done by the login page is a `GET` call. The fix done is to change the used interface for the product alerts from `POST` to `GET`, as this is the easy fix and there's no reason to use `POST` here at this moment, as all parameters for the call are all in get URL parameters. --- app/code/Magento/ProductAlert/Controller/Add/Price.php | 4 ++-- app/code/Magento/ProductAlert/Controller/Add/Stock.php | 4 ++-- .../ProductAlert/view/frontend/templates/product/view.phtml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/ProductAlert/Controller/Add/Price.php b/app/code/Magento/ProductAlert/Controller/Add/Price.php index fbaff109fd15a..b7519f0bc7a57 100644 --- a/app/code/Magento/ProductAlert/Controller/Add/Price.php +++ b/app/code/Magento/ProductAlert/Controller/Add/Price.php @@ -6,7 +6,7 @@ namespace Magento\ProductAlert\Controller\Add; -use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\ProductAlert\Controller\Add as AddController; use Magento\Framework\App\Action\Context; use Magento\Customer\Model\Session as CustomerSession; @@ -20,7 +20,7 @@ /** * Controller for notifying about price. */ -class Price extends AddController implements HttpPostActionInterface +class Price extends AddController implements HttpGetActionInterface { /** * @var \Magento\Store\Model\StoreManagerInterface diff --git a/app/code/Magento/ProductAlert/Controller/Add/Stock.php b/app/code/Magento/ProductAlert/Controller/Add/Stock.php index 24cab39d544fc..f36fdf5fb715e 100644 --- a/app/code/Magento/ProductAlert/Controller/Add/Stock.php +++ b/app/code/Magento/ProductAlert/Controller/Add/Stock.php @@ -6,7 +6,7 @@ namespace Magento\ProductAlert\Controller\Add; -use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\ProductAlert\Controller\Add as AddController; use Magento\Framework\App\Action\Context; use Magento\Customer\Model\Session as CustomerSession; @@ -19,7 +19,7 @@ /** * Controller for notifying about stock. */ -class Stock extends AddController implements HttpPostActionInterface +class Stock extends AddController implements HttpGetActionInterface { /** * @var \Magento\Catalog\Api\ProductRepositoryInterface diff --git a/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml b/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml index 5b9553a49e723..462196d773aab 100644 --- a/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml +++ b/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml @@ -6,7 +6,7 @@ ?>
- escapeHtml(__($block->getSignupLabel())) ?>