Problem/Motivation
It seems that since the new Search API Tag based caching has been introduced, the SearchApiDisplay facet source does not seem to support displays, that are not views-driven, for example custom SearchAPIDisplays.
The reason is that getCacheContexts(), getCacheTags() and getCacheMaxAge() are now depending on $this->getViewsDisplay() to return an actual view. This will be NULL for non-views-based Facets sources.
See https://git.drupalcode.org/project/facets/-/blob/2.0.x/src/Plugin/facets...
Was this intended? Before the changes the facet source seem to haven't had a strict views dependency. Or am I on the wrong track?
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3294519-custom_display_cache_support.patch | 3.58 KB | mkalkbrenner |
| #7 | 3294519-7.patch | 2.07 KB | mkalkbrenner |
| #5 | interdiff-2-5.diff.txt | 1.77 KB | szeidler |
| #5 | 3294519-5.patch | 1.98 KB | szeidler |
| #2 | 3294519.patch | 1.98 KB | mkalkbrenner |
Comments
Comment #2
mkalkbrennerComment #4
szeidlerThanks @mkalkbrenner for the patch. The approach seems to be the right way to go. But we need to change the condition, because
$this->getViewsDisplay()is already NULL and therefore lead to an error.Comment #5
szeidlerHere's an updated patch. Could you check?
Comment #7
mkalkbrennerComment #8
mkalkbrennerComment #9
szeidlerThis looks good now!
Comment #12
mkalkbrenner