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

brechtvdv’s picture

StatusFileSize
new945 bytes

Using 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?

sebto’s picture

I have the same problem. This patch works for me.

jeroent’s picture

Issue summary: View changes
Status: Active » Needs review

Patch worked for me.

markpavlitski’s picture

Version: 7.x-2.6 » 7.x-2.x-dev
StatusFileSize
new1.43 KB
new656 bytes

I've switched the rest of the function to use $view->total_rows rather than $count since 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.

Ravenight’s picture

patch # 4 worked for me.

  • markpavlitski committed 6967f27 on 7.x-2.x
    Issue #1916604 by markpavlitski, brechtvdv: Integration with Search API...
markpavlitski’s picture

Status: Needs review » Fixed

This has been fixed in the 7.x-2.x-dev branch.

Status: Fixed » Closed (fixed)

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