Views result cache does not apply cacheable metadata from entity query

Created on 25 January 2023, almost 3 years ago

Problem/Motivation

Views caches the results and applies cache tags from the SQL query, not from the entity query that was used.

in Drupal\views\Plugin\views\query::getCacheTags only the cache tags belonging to the entities of each row are applied.

This means that entity queries that apply cache tags to the entity query conditions are not invalidated properly in views.

Steps to reproduce

Proposed resolution

In ViewsQueryAlter somehow pass the Cacheable Meta data to the views executable object, and then pick it up in a Views Cache plugin shipped with this module that extends Tag.php

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

1.0

Component

Views integration

Created by

🇪🇸Spain nuez Madrid, Spain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024