Core has 2 PageDisplayVariant plugins, those 2 plugins does not inject the cacheable metadata into the returned build array.
In app/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php, the PageDisplayVariantSelectionEvent event are injected into the plugin instance:
// Instantiate the page display, and give it the main content.
$page_display = $this->displayVariantManager->createInstance($variant_id, $variant_configuration);
...
$page_display
...
->addCacheableDependency($event);
But then in core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php and core/lib/Drupal/Core/Render/Plugin/DisplayVariant/SimplePageVariant.php there is no usage of those cache metadata in the build method.
In the related issue we witnessed the problem when needing to inject a cache tag in the event for cache invalidation.
Inject cache metadata in the build method.
Provide MR
Provide test
Active
11.0 🔥
block.module
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.