With Magento 2.0.4 cache, more specifically page cache enabled, everything works.
If I disable it, clear cookies, and login as customer than products in minicart are not there.
Welcome message does not really work right. I have to add a product to cart from a product page in order to see the minicart. Than if I go to checkout, country is not displayed in address summary (shipping address already added in my account).
I've done debugging and it looks like the problem is pointing to:
module-customer/view/frontend/web/js/customer-data.js
.
The cookie private_content_version
is set in module-page-cache/view/frontend/web/js/page-cache.js
and used in customer-data.js
. See customerData::reload
function.
With page cache disabled, the data is not loaded from the server as the function dataProvider::getFromServer()
does.
When page cache is disabled the cookie private_content_version
is not there (page-cache.js is not executed off course). But the cookie section_data_ids
has only '*' and 'messages' => empty (false or null).
When page cache is enabled there is private_content_version
and section_data_ids
has what keys with values:
*: null
cart: 123
compare-products: 123
customer: 123
directory-data: 123
last-ordered-items: 123
multiplewishlist: 123
review: 123
wishlist: 123
After I login with page cache enabled, on customer dashboard there are 2 additional ajax requests that load data:
http://test.localhost/customer/section/load/?sections=&update_section_id=false&_=123
http://test.localhost/customer/section/load/?sections=directory-data&update_section_id=false&_=123
These contain json objects with customer specific data and directory data like all countries and regions.
With these calls, on checkout the address summary displays the country name.
See: module-customer/view/frontend/web/js/sections-config.js
and module-checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js
, function getCountryName
.
Is this a Magento 2 bug or it's something that I messed up ? Thanks
GET http://example.com/customer/section/load/?sections=&update_section_id=false&_=1462374643065 500 (Internal Server Error)
– maginfortis May 11 '16 at 10:22