From 10ac0ef8d04e21a771358492a19a29b20bfcafc2 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Fri, 2 Sep 2016 16:21:34 +0300 Subject: [PATCH 1/3] Update customer-data when Full page cache disabled --- .../Magento/Customer/view/frontend/web/js/customer-data.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index a3ef770fffdf4..84d98777ad39a 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -190,10 +190,8 @@ define([ var countryData, privateContent = $.cookieStorage.get('private_content_version'); - if (_.isEmpty(storage.keys())) { - if (!_.isEmpty(privateContent)) { - this.reload([], false); - } + if (_.isEmpty(storage.keys()) && !_.isEmpty(privateContent)) { + this.reload([], false); } else if (this.needReload()) { _.each(dataProvider.getFromStorage(storage.keys()), function (sectionData, sectionName) { buffer.notify(sectionName, sectionData); From dccf8c88c5921aa24a8fdbee0948808c9c30b221 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Tue, 23 May 2017 14:03:42 +0300 Subject: [PATCH 2/3] Update customer-data when Full page cache disabled Revert commit 861f596 --- .../PageCache/Model/App/FrontController/BuiltinPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php b/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php index 7c2d4f2edd8bb..7889ac197d371 100644 --- a/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php +++ b/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php @@ -64,10 +64,10 @@ public function aroundDispatch( \Closure $proceed, \Magento\Framework\App\RequestInterface $request ) { - $this->version->process(); if (!$this->config->isEnabled() || $this->config->getType() != \Magento\PageCache\Model\Config::BUILT_IN) { return $proceed($request); } + $this->version->process(); $result = $this->kernel->load(); if ($result === false) { $result = $proceed($request); From 4ebc6f2f1955621b401bd521e87825945e855eb4 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Tue, 23 May 2017 14:05:20 +0300 Subject: [PATCH 3/3] Update customer-data when Full page cache disabled Revert commit 9efb5ad --- .../Test/Unit/Model/App/FrontController/BuiltinPluginTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php index bcfa1c0728d67..103b0af2a8153 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php @@ -219,7 +219,7 @@ public function testAroundDispatchDisabled($state) ->method('isEnabled') ->will($this->returnValue(true)); $this->versionMock - ->expects($this->once()) + ->expects($this->never()) ->method('process'); $this->stateMock->expects($this->any()) ->method('getMode')