Closed
Description
In Magento_PageCache/Observer/ProcessLayoutRenderElement.php when _isScopePrivate is true in a block, wrong block placeholder is generated, it contains private data, which is cached by Varnish. The placeholder should be empty, so it can be populated by ajax.
Steps to reproduce
- create a new block, and set _isScopePrivate to true (a property from abstract, originally set to false), this way we indicate we want cache hole punch for this block
- try to get data from customer session (e.g. check if the customer is logged in)
- place the block (layout xml) in a way to be used in both cached and non-cached pages, in the latter the information will be correct, on cached pages it won't get through.
Expected result
- The placeholder should be empty, so it can be populated by ajax.
Actual result
- Wrong block placeholder is generated, it contains private data, which is cached by Varnish