Unverified Commit 05f20db9 authored by harrrrrrr's avatar harrrrrrr Committed by Mateu Aguiló Bosch

fix(Cacheability): Prevent disabling Dynamic Page Caching (#2919197 by harrrrrrr)

parent 6f5d000a
......@@ -66,9 +66,11 @@ trait EntityNormalizerTrait {
$entity_type_id = $resource_type->getEntityTypeId();
$bundle_id = $resource_type->getBundle();
// The output depends on the configuration entity for caching.
$context['cacheable_metadata']->addCacheableDependency(
$this->getResourceConfig($entity_type_id, $bundle_id)
);
if ($resource_config = $this->getResourceConfig($entity_type_id, $bundle_id)) {
$context['cacheable_metadata']->addCacheableDependency(
$resource_config
);
}
$context['cacheable_metadata']->addCacheableDependency(
\Drupal::config('jsonapi_extras.settings')
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment