Loading
Issue #3627291: Layout Paragraphs Builder (Experimental) formatter does not add the cacheability of its access check to the build
Closes #3627291.
LayoutParagraphsBuilderFormatter::view() now keeps the builder access result and adds it as a cacheable dependency to the build it returns, with and without the builder. The render cache and the Dynamic Page Cache then vary the builder by what the access check depends on, for example per user with "Edit own content".
Tests:
- Kernel:
BuilderFormatterAccessCacheabilityTestchecks theusercache context and the node cache tag on the build for the author (with the builder) and for another editor with the same role (without it). - Cypress:
builder-formatter-access-cache.cy.jsviews a node as its author, then as another editor with the same role, and checks the second one does not get the builder.