backdrop-contrib / search_api

Provides a generic API for modules offering search capabilities
GNU General Public License v2.0
0 stars 6 forks source link

Taxonomy filter view queries taxonomy_vocabulary #69

Open kswan opened 2 months ago

kswan commented 2 months ago

If I add a "Parent terms (indexed)" Taxonomy filter to a search_api based view, I get this error.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sewscms-dev.taxonomy_vocabulary' doesn't exist: SELECT td.* FROM {taxonomy_term_data} td INNER JOIN {taxonomy_vocabulary} tv ON td.vid = tv.vid WHERE (tv.machine_name = :db_condition_placeholder_0) ORDER BY tv.weight ASC, tv.name ASC, td.weight ASC, td.name ASC; Array ( [:db_condition_placeholder_0] => vehicle )

As the error message shows, my database doesn't have a taxonomy_vocabulary table. taxonomy_vocabulary was eliminated in the transition from D7 to Backdrop.

I see this query is built here https://github.com/backdrop-contrib/search_api/blob/9d38133469c1972c9b10f83bfb7e67dd067b35c3/contrib/search_api_views/includes/handler_filter_taxonomy_term.inc#L96.

kswan commented 2 months ago

I found a couple other places where the taxonomy_vocabulary table is added to queries.

https://github.com/backdrop-contrib/search_api/blob/9d38133469c1972c9b10f83bfb7e67dd067b35c3/contrib/search_api_views/includes/handler_filter_taxonomy_term.inc#L275

https://github.com/backdrop-contrib/search_api/blob/9d38133469c1972c9b10f83bfb7e67dd067b35c3/includes/datasource_entity.inc#L166