Hi, I'm trying to create a jCarousel view based on indexed search results (from Search API). When I converted my previous view, or created a new one from scratch, I get the following error:
Fatal error: Call to a member function countQuery() on a non-object in /sites/all/modules/jcarousel/includes/jcarousel.views.inc on line 146
When I'm editing this in the Views form, it just causes an AJAX HTTP error popup. When I try to visit the page with the block, I get the White Screen of Death (and with the error set to output, it gives me the same above error).
I'm not sure if its a Search API integration error, or something different (I noticed other issues with similar errors)
Comments
Comment #1
brechtvdv commentedUsing search api (combined with SOLR) the information used in 'jcarousel.views.inc on line 146' is not correctly filled in. This is because internally the SOLR backend doesn't use queries, therefore the count query and the normal query in $view->build_info['count_query'] is NULL.
A few lines down the $view->total_rows is filled with this $count that is calculated with the count query. In the case of SOLR (with search api) the property total_rows is already filled in.
In attachment is a patch which skips the count query when it is empty. It is ok for the case of search api because the total_rows is already filled in. I don't know if there are other cases to consider?
Comment #2
sebto commentedI have the same problem. This patch works for me.
Comment #3
jeroentPatch worked for me.
Comment #4
markpavlitski commentedI've switched the rest of the function to use
$view->total_rowsrather than$countsince in this case total_rows will have been filled in by Search API module, but $count will be NULL.Otherwise it's the same as #1.
Comment #5
Ravenight commentedpatch # 4 worked for me.
Comment #7
markpavlitski commentedThis has been fixed in the 7.x-2.x-dev branch.