5

Shortly after applying the SUPEE-9767 patch we started to receive complaints from customers that products could not be added to cart from the product detail page.

We are sometimes able to reproduce the issue, but sometimes not.

We are on a fully patched version of EE 1.14.2.2.

Disabling full page cache resolves the issue.

cmtickle
  • 416
  • 2
  • 6

2 Answers2

7

The issue is caused by the Enterprise Page Cache.

The form key is created at: app/code/core/Enterprise/PageCache/Model/Processor.php:422 which ultimately calls setcookie().

Then the cookie value is retrieved at: app/code/core/Enterprise/PageCache/Model/Observer.php:1043 in the same request.

As the headers/cookies have not been sent the value returned is null. This causes the core/session cookie to not update with the value Page Cache has just created which is supposed to happen at:

app/code/core/Enterprise/PageCache/Model/Observer.php:1045. 

The patch below will resolve this issue. https://gist.github.com/cmtickle/477aba06d8d6a69148de542bfb56ed45

Raphael at Digital Pianism
  • 70,385
  • 34
  • 188
  • 352
cmtickle
  • 416
  • 2
  • 6
  • in EE 1.14.3.3 the code is correct and uses a slightly better variant than what your gist uses. also, PATCH_SUPEE-9767_EE_1.14.3.2_v1-2017-05-22-07-20-39.sh does seem to modify the observer accordingly, but might be missing the Cookie.php changes. are you sure your patch applied successfully, as the end result would look different from what the gist's initial code state is... – alternize Jun 07 '17 at 22:31
  • this is part of a cache problem we reported a few weeks ago and was partly fixed as SUPEE-9805 before it was integrated in SUPEE-9767 - at least for the 1.14.3.x version, maybe it was not properly backported. – alternize Jun 07 '17 at 22:42
  • I've confirmed that the patch was applied successfully without issue. May be an issue in 1.14.2.x – cmtickle Jun 08 '17 at 07:37
  • Once my patch for the patch is applied you may need to clear Block and FP cache for it to work as expected. – cmtickle Jun 08 '17 at 08:32
  • Any idea if v1.13.1.0 is affected by this? I have a client that is having an add to cart issue since the patch, but I can't reproduce it at all. – Laura Jun 09 '17 at 14:01
  • Sorry, I don't know if 1.13 is affected. If you use xdebug, put breakpoints in at the lines I mentioned and watch the form keys to see what happens? – cmtickle Jun 10 '17 at 15:05
0

We fixed a 1.14.3.2 installation by backporting the PageCache module entirely from 1.14.3.3. Be careful that the local pool override doesn't work, so we had to edit the core. I hope Ben Marks won't notice what I just wrote.

ermannob
  • 224
  • 1
  • 16