Skip to content

Commit

Permalink
Merge pull request #981 from StadGent/feature/HEAT-6670607
Browse files Browse the repository at this point in the history
HEAT-6670607: Update cache key if viewmode changes
  • Loading branch information
Jelle-S authored Feb 13, 2024
2 parents b17516c + 0e567ff commit 2d29a87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gent_base.theme
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ function gent_base_preprocess_field__field_contacts(&$variables) {
}
$variables['items'][$key]['content']['#view_mode'] = $view_mode;
$variables['items'][$key]['content']['#cache']['tags'] = $entity->getCacheTags();
$cache_key = array_search('teaser', $variables['items'][$key]['content']['#cache']['keys']);
if ($cache_key !== FALSE) {
$variables['items'][$key]['content']['#cache']['keys'][$cache_key] = $view_mode;
}
}
}

Expand Down

0 comments on commit 2d29a87

Please sign in to comment.