From a08f23575d5e7e2ad2aa0f2fea2fcf6a09f1cd71 Mon Sep 17 00:00:00 2001 From: orakili Date: Wed, 1 Nov 2023 04:44:17 +0000 Subject: [PATCH] fix: caching of story nodes Refs: UNO-757 --- html/modules/custom/unocha_paragraphs/unocha_paragraphs.module | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html/modules/custom/unocha_paragraphs/unocha_paragraphs.module b/html/modules/custom/unocha_paragraphs/unocha_paragraphs.module index 45ec9f63..50944c9c 100644 --- a/html/modules/custom/unocha_paragraphs/unocha_paragraphs.module +++ b/html/modules/custom/unocha_paragraphs/unocha_paragraphs.module @@ -155,6 +155,9 @@ function unocha_paragraphs_preprocess_paragraph__stories(array &$variables) { if (is_array($item) && isset($item['#node'])) { if (in_array($item['#node'], $featured)) { $build[$key]['#attributes']['class'][] = 'featured'; + // Use a different cache key to ensure the added class is taken into + // account. + $build[$key]['#cache']['keys'][] = 'featured'; } // Only change the view mode of the first story.