Unable to render EntityFields in views with search_api_opensearch

Created on 4 February 2022, over 2 years ago
Updated 18 February 2023, over 1 year ago

Problem/Motivation

I am unable to render fields using the SearchApiEntityField plugin in views, even when the search query returns a result. I am using search_api_opensearch as the back end.

Tracking this down I think this is because, in SearchAPIEntityField there are the following lines in getItems:

if ($values->search_api_datasource != $this->getDatasourceId()) {
  return [];
}

Inspecting $values I see that $values->search_api_datasource is an array of one data source id whereas $this->getDatasourceId() is a string. The data source ids to match. I don't know whether search_api_datasource should not be an array, or whether the if statement is incorrect.

Remaining tasks

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Views integration

Created by

πŸ‡¬πŸ‡§United Kingdom rlmumford Manchester

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024