Skip to content
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

2.1.9 Item not added to the Wishlist if the user is not logged at the moment he click on the button to add it. #11825

Closed
carloricci84 opened this issue Oct 27, 2017 · 11 comments
Assignees
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@carloricci84
Copy link

Preconditions

  1. Magento 2.1.9 installed

Steps to reproduce

  1. Create an user account.
  2. Logout from the user account
  3. Add a product to your Wishlist , you will get redirected to the login page
  4. Login

Expected result

  1. You are redirected to the customer account Wishlist page and the product is added.

Actual result

  1. You are redirected to the customer account Wishlist page but the product is not added.

Looking at the bug fix "APPSEC-1755: Anti-CSRF form_key is not changed after login" here https://magento.com/security/patches/magento-2016-and-219-security-update , it seems that since the form key is now changed after the login, the form key used for the Wishlist in vendor/magento/module-wishlist/Controller/Index/Add.php does not validate at the beginning of the execute function.

public function execute()
{
    /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
    $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
    if (!$this->formKeyValidator->validate($this->getRequest())) {
        return $resultRedirect->setPath('*/');
    }
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 27, 2017
@magento-engcom-team
Copy link
Contributor

@carloricci84, thank you for your report.
We've created internal ticket(s) MAGETWO-82985 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Oct 30, 2017
@osrecio
Copy link
Member

osrecio commented Nov 4, 2017

I am working on it at #mm17es

@maksek maksek added the mm17es label Nov 5, 2017
vkublytskyi pushed a commit to osrecio/magento2 that referenced this issue Dec 1, 2017
… replace for oldRequestParams Wishlist magento#12042

 - fixed unit test
vkublytskyi pushed a commit to osrecio/magento2 that referenced this issue Dec 1, 2017
magento-team pushed a commit that referenced this issue Dec 1, 2017
…e for oldRequestParams Wishlist #12041

 - Merge Pull Request #12041 from osrecio/magento2:PR#11825_2.1
 - Merged commits:
   1. 5368727
   2. f79d97e
magento-team pushed a commit that referenced this issue Dec 1, 2017
magento-team pushed a commit that referenced this issue Dec 1, 2017
[EngCom] Public Pull Requests - 2.1-develop
 - MAGETWO-83288: [Backport 2.1] #11825: Generate new FormKey and replace for oldRequestParams Wishlist #12041
magento-team pushed a commit that referenced this issue Dec 1, 2017
…tParams Wishlist #12038

 - Merge Pull Request #12038 from osrecio/magento2:PR#11825_2.2
 - Merged commits:
   1. 03ac5b5
   2. 7edc2d4
   3. 04a1c77
okorshenko pushed a commit that referenced this issue Dec 1, 2017
…e for oldRequestParams Wishlist #12042

 - Merge Pull Request #12042 from osrecio/magento2:PR#11825_2.3
 - Merged commits:
   1. 247cfe6
   2. 3b442ad
   3. cc1602f
okorshenko pushed a commit that referenced this issue Dec 1, 2017
okorshenko pushed a commit that referenced this issue Dec 1, 2017
[EngCom] Public Pull Requests - develop
 - MAGETWO-83289: [Backport 2.3] #11825: Generate new FormKey and replace for oldRequestParams Wishlist #12042
 - MAGETWO-84529: [2.3] Correct flat indexing with staging and > 500 cats #12345
@okorshenko
Copy link
Contributor

The issue has been fixed and delivered to 2.1-develop, 2.2-develop and 2.3-develop branches. Will be available with upcoming patch release

@okorshenko okorshenko added Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line labels Dec 1, 2017
@thaddeusmt
Copy link

Are we sure this is fixed in 2.2.2? I am seeing this exact same bug. If you go through the login form, the form_key changes and when module-wishlist/Controller/Index/Add.php::execute() runs it fails at the $this->formKeyValidator->validate($this->getRequest()) line, just as described.

@osrecio
Copy link
Member

osrecio commented Jan 2, 2018

Hi @thaddeusmt I tested with branch 2.2-develop with sample data and works fine.

This issue will be added to 2.2.4

@lalit-algoworks
Copy link

I am facing issue with magento 2.2.2 wishlist. Item are not added in wishlist if user logged out.
Here are the steps with sample data
Steps to reproduce.

  1. Click on item when user is not logged in
    image
  2. It redirect to login screen.
    image
  3. After login it shows.
    image

There is one more issue in wishlist.
If user have some item in their wishlist it should highlight on that item page/category page, but it not.
image
image
image

Please provide way to solve it.

@osrecio
Copy link
Member

osrecio commented Jan 3, 2018

Hi @lalit-algoworks this issue will be fixed in 2.2.4

@thaddeusmt
Copy link

Magento support gave us a patch for 2.2.2, so perhaps it will be fixed in 2.2.3+

@sivajik34
Copy link
Contributor

can you share me the patch

@thaddeusmt
Copy link

magento_2.2.2_add-to-wishlist-login-register_patch.txt

@matheus0608
Copy link

not work, add item wishlist magento 2.3 Invalid Form Key,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

9 participants