I have restricted to the permissions for published content to not permit anonymous users to view this content. In other words, only authenticated users and site administrators can view published content. I have also created an Apache Solr view of a table containing these fields: label, a custom text field, a custom date field, and the path to the node. I'm also using a custom views template to generate the label as a link to the node, e.g., views-view-table-content_type-.tpl.php.
When an anonymous user goes to the views page, these notices and warnings are displayed, while the table is not displayed as expected.
Notice: Undefined property: stdClass::$name in apachesolr_access_apachesolr_query_alter() (line 101 of /home/drupal/public_html/sites/all/modules/apachesolr/apachesolr_access/apachesolr_access.module).
Notice: Trying to get property of non-object in apachesolr_views_query->execute() (line 159 of /home/drupal/public_html/sites/all/modules/apachesolr_views/apachesolr_views_query.inc).
Notice: Trying to get property of non-object in apachesolr_views_query->execute() (line 159 of /home/drupal/public_html/sites/all/modules/apachesolr_views/apachesolr_views_query.inc).
Notice: Trying to get property of non-object in apachesolr_views_query->execute() (line 165 of /home/drupal/public_html/sites/all/modules/apachesolr_views/apachesolr_views_query.inc).
Notice: Trying to get property of non-object in apachesolr_views_query->execute() (line 165 of /home/drupal/public_html/sites/all/modules/apachesolr_views/apachesolr_views_query.inc).
Warning: array_values() expects parameter 1 to be array, null given in view->execute() (line 1163 of /home/drupal/public_html/sites/all/modules/views/includes/view.inc).
The other non-views pages say "You are not authorized to access this page." Perhaps the Apache Solr views should do something similar.
Comment | File | Size | Author |
---|---|---|---|
#3 | handle_aborted_query-2458411-3.patch | 1.14 KB | MiroslavBanov |
Comments
Comment #1
orange-wedge CreditAttribution: orange-wedge commentedComment #2
MiroslavBanov CreditAttribution: MiroslavBanov commentedI guess that apachesolr_views does not work well with apachesolr_access, and does not handle "abort_search" at all. As a workaround, you could try setting access to the view directly: "Access: Permission | View published content". I still think that we should try to handle $query->abort_search, even if this workaround helps in your situation.
Comment #3
MiroslavBanov CreditAttribution: MiroslavBanov commentedHere is a patch to try to handle aborted apachesolr query.
Comment #4
MiroslavBanov CreditAttribution: MiroslavBanov commentedDuplicate of #2382091: Handle aborted query.