When I use Views Search API with a view without a pager I get the following error:

PHP Fatal error: Call to a member function use_count_query() on a non-object in search_api/contrib/search_api_views/includes/query.inc on line 347

Comments

John Cook created an issue. See original summary.

john cook’s picture

Status: Active » Needs review
StatusFileSize
new360 bytes

This comes about because $this->pager returns NULL, then an attempt is made to call a method; which fails.

I've created a patch to check for an empty pager setting before calling methods on it.

john cook’s picture

StatusFileSize
new1.45 KB

The last submitted patch, 2: search_api_views-2744995-2.patch, failed testing.

drunken monkey’s picture

Component: General code » Views integration
Status: Needs review » Fixed

Didn't know that the pager could be NULL, thanks for pointing that out!
Reformatted the code a bit according to my taste and then committed.
Thanks again!

Status: Fixed » Closed (fixed)

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