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

szeidler created an issue. See original summary.

mkalkbrenner’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new1.98 KB

Status: Needs review » Needs work

The last submitted patch, 2: 3294519.patch, failed testing. View results

szeidler’s picture

Thanks @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.

szeidler’s picture

Status: Needs work » Needs review
StatusFileSize
new1.98 KB
new1.77 KB

Here's an updated patch. Could you check?

Status: Needs review » Needs work

The last submitted patch, 5: 3294519-5.patch, failed testing. View results

mkalkbrenner’s picture

Status: Needs work » Needs review
StatusFileSize
new2.07 KB
mkalkbrenner’s picture

StatusFileSize
new3.58 KB
szeidler’s picture

Status: Needs review » Reviewed & tested by the community

This looks good now!

  • mkalkbrenner committed b24595f on 2.0.x
    Issue #3294519 by mkalkbrenner, szeidler, borisson_: New Search API Tag...

mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.