Hi,

I'm working with Relation module and got the following error when applying a view:
Fatal error: Cannot access protected property SearchApiViewsQuery::$fields in .../sites/all/modules/relation/relation_entity_collector/relation_entity_collector.module on line 255

I didn't know if this problem should better be reported here or in Relation queue.
What should be done?

Thanks,

Comments

drunken monkey’s picture

Project: Search API » Relation
Version: 7.x-1.0 » 7.x-1.x-dev
Component: Views integration » Views

It's a problem that many Views-related modules have, i.e., not taking into account non-default query plugins. The code seems to assume that the query object has a readable $fields property, which isn't the case in the Search API. Therefore, the code fails.

Moving this to the correct issue queue …

marty2081’s picture

For now we changed line 433 of relation_entity_collector.module (7.x-1.0-rc2) into:

  if (isset($view->query->fields) && _relation_entity_collector_user_has_access()) {

This prevents the error by checking if the fields property exists. However, I don't know what the purpose of the views_post_execute() code of the entity_collector is. Does the code make any sense if there is no fields property?

marty2081’s picture

We installed the latest dev version of Relation and this seems to be fixed now?

mikran’s picture

Status: Active » Closed (fixed)

closing if it seems fixed