In apachesolr_views_query->execute() the result from apachesolr_do_query() is not tested which causes a warning and four notices.

When a solr query is aborted in e.g. apachesolr_access_build_subquery because of an access check it throws an exception.
apachesolr_access_apachesolr_query_alter catches that error, saves a watchdog messages and sets

$query->abort_search = TRUE

resulting in the later return of NULL by apachesolr_do_query().

We then get:

Warning: array_values() expects parameter 1 to be array, null given in view->execute() (regel 1163 van ..../profiles/commons/modules/contrib/views/includes/view.inc).

And twice these two:

Notice: Trying to get property of non-object in apachesolr_views_query->execute() (regel 156 van ...../sites/all/modules/apachesolr_views/apachesolr_views_query.inc).
Notice: Trying to get property of non-object in apachesolr_views_query->execute() (regel 150 van ...../sites/all/modules/apachesolr_views/apachesolr_views_query.inc).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

helmo’s picture

Status: Active » Needs review
FileSize
965 bytes

Here's a mockup patch that checks this. (just as a proof of concept)

Status: Needs review » Needs work

The last submitted patch, 1: handle_aborted_query-2382091-1.patch, failed testing.

helmo’s picture

Issue summary: View changes
FileSize
807 bytes

Apparently it was too late for a correct patch :) ... here's a better one.

helmo’s picture

Status: Needs work » Needs review
MiroslavBanov’s picture

Oops, I guess I missed this issue. There is already a duplicate now: #2458411: Permission: View published content set to only authenticated user and administrator.

MiroslavBanov’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.