backdrop-contrib / search_api

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

Call to undefined function entity_view()... line 78 ...modules/contrib/entity_plus/views/plugins/entity_plus_views_plugin_row_entity_view.inc #18

Closed ghost closed 3 years ago

ghost commented 3 years ago

After creating and configuring a Search Server and Search Index, I am attempting to create a new View of the custom type "Organization Search" which is my configured custom Search Index. When executing the view preview or visiting its page, I receive the following error:

Error: Call to undefined function entity_view() in entity_plus_views_plugin_row_entity_view->pre_render() (line 78 of /var/www/directorio/modules/contrib/entity_plus/views/plugins/entity_plus_views_plugin_row_entity_view.inc).

The offending line is: $render = entity_view($this->entity_type, $this->entities, $this->options['view_mode']);

The function entity_view() does not appear to be defined in the core entity module (Backdrop CMS 1.18.1), although it exists in the Drupal 7 entity module counterpart.

ghost commented 3 years ago

This seems related to #13 and seems to be fixed by switching to entity_plus_view in line 78 & entity_plus_id later in line 94. The latest release was not working for me out of the box.

earlyburg commented 3 years ago

This is a bug that I feel may have been dealt with already, but I'll have a look.

earlyburg commented 3 years ago

@erictoupin Line 77 in this github repo shows: " $render = entity_plus_view($type, array($item->id() => $item), $mode, $item->search_api_language); " https://github.com/backdrop-contrib/search_api/blob/1.x-1.x/includes/callback_add_viewed_entity.inc

I feel that it might be possible that you are not using the latest release found here: https://github.com/backdrop-contrib/search_api/releases/tag/1.x-1.0.03 Please let me know if you experience any further issues.

ghost commented 3 years ago

@earlyburg thanks for the super quick response. I believe I filed this incorrectly, as it is actually the entity_plus module throwing the error at entity_plus_views_plugin_row_entity_view.inc. It is thrown when visiting a search view configured with Search API views.