8

SUPEE-9697 has broken the Design Exceptions functionality of Magento Enterprise with Full Page cache. This feature is normally used for serving a mobile theme.

To recreate the issue (with full page cache enabled and a design exception defined):

  • Flush full page cache.
  • In Chrome, enable developer tools and toggle the device toolbar.
  • Switch to a device which will activate your theme (e.g. an iPhone).
  • Visit the site and confirm you see your mobile theme.
  • Toggle the developer tools device toolbar so you now see a desktop view.
  • Refresh the page.

Undesirable behaviour:

  • You will see that the template being served (by full page cache) is the mobile template, which is incorrect.
5

This issue is caused by the patch using Zend_Json to encode values into the cache in the Enterprise PageCache Observer where previously serialize was used.

The Fix (copy the file to local to avoid editing core):

app/code/core/Enterprise/PageCache/Model/Processor.php:195

Change:

$exceptions = @unserialize($exceptions);

To:

$exceptions = @Zend_Json::decode($exceptions);
  • Does this solve also user agent exceptions only in layout, even if using the same package? I'm asking so because this is my configuration, and this solution is not working. In $exception variable I can see the values have not been unserialized. – Fra H Jun 8 '17 at 10:57
  • It should solve all design exception issues. Did you clear full page cache after applying the fix? – cmtickle Jun 8 '17 at 19:06
  • Unfortunately yes. I', running a 1.13.1.0 version, with all patches applied. I'll try to figure out why. Configuration has exceptions only on model, theme, and layout. – Fra H Jun 9 '17 at 12:57
  • I even tried to add an exception to the package.. well, the whole thing is not working :( – Fra H Jun 9 '17 at 15:13
  • Reverting the patch, the theme exception is working again. – Fra H Jun 13 '17 at 8:33
2

Also on magento v1.13.1 (@thundar) and the code is slightly different than the accepted answer.

It's on line 196 instead of 195 and the original code was:

$rules = @unserialize($exceptions);

Should become:

$rules = @Zend_Json::decode($exceptions);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.