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
Comments
Comment #2
mkalkbrennerComment #4
szeidler commentedThanks @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
szeidler commentedHere's an updated patch. Could you check?
Comment #7
mkalkbrennerComment #8
mkalkbrennerComment #9
szeidler commentedThis looks good now!
Comment #12
mkalkbrenner