I have a view that shows the title of a single content type as an unformatted list. I have an argument for a nid-contextual filter that I pass to the view in
function modulename_views_pre_view($view, $display_id, array &$args) {
....
$args[0] = $filter_value;
}
The value for the contextual filter is a value the user can select and is set in \Drupal::service('user.private_tempstore')
. Every time the user selects a different value from a select form element, the view should show different results. However, it caches the output and only if I clear all caches it shows the correct output. But if I format the view output as a table, then everything works totally fine and the new results are shown immediately.
The cache tags for this view are given as follows:
print_r($view->getCacheTags());
Array ( [0] => config:views.view.users_in_class [1] => node_list )
Do I have to specifically invalidate something here or am I missing something else ? I thought that the cache tag node_list
would already be enough. And why are results being cached when having the format as an unformatted list?