diff --git a/config/schema/gaa_quick_exit.schema.yml b/config/schema/quick_exit.schema.yml similarity index 100% rename from config/schema/gaa_quick_exit.schema.yml rename to config/schema/quick_exit.schema.yml diff --git a/quick_exit.module b/quick_exit.module index 7b91d8b1e7434a2e8a60f0fd248026a0d2cbb34b..c06707a62e09398f5562c3d3aca0bfef6a45a45c 100644 --- a/quick_exit.module +++ b/quick_exit.module @@ -7,6 +7,8 @@ declare(strict_types=1); +use Drupal\Core\Cache\Cache; + /** * Implements hook_page_attachments_alter(). */ @@ -22,6 +24,8 @@ function quick_exit_page_attachments(array &$attachments): void { * Implements hook_preprocess_page(). */ function quick_exit_preprocess_page(array &$variables): void { - $exit_urls = \Drupal::config('quick_exit.settings')->get('exit_urls'); - $variables['#attached']['drupalSettings']['quick_exit']['exit_urls'] = $exit_urls; + $config = \Drupal::config('quick_exit.settings'); + $variables['#attached']['drupalSettings']['quick_exit']['exit_urls'] = $config->get('exit_urls'); + $variables['page']['#cache']['tags'] = Cache::mergeTags($variables['page']['#cache']['tags'], $config->getCacheTags()); + $variables['page']['#cache']['contexts'] = Cache::mergeContexts($variables['page']['#cache']['contexts'], $config->getCacheContexts()); }