AFter creating a Search API view based on my index, with an exposed Fulltext filter, I get this:

Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in C:\Inetpub\wwwroot\xxx.net\includes\common.inc on line 2157 and defined in drupal_http_build_query() (line 473 of C:\Inetpub\wwwroot\xxx.net\includes\common.inc). => 

This is what happens when I search with keyword 'Rich':

drupal_http_build_query('Rich')

That should be an array, but it passes my search string as the argument.

This related error happens too:

Warning: Invalid argument supplied for foreach() in drupal_http_build_query() (line 476 of C:\Inetpub\wwwroot\thakafa.net\includes\common.inc).

Same issue with latest beta5 and latest dev.

Comments

Anonymous’s picture

Hi, you wouldn't have guessed this, but if you custom change the 'Filter identifier' to "query" - that's the cause of above errors. Apparently, "query" is a protected drupal key. If I change it back to anything else, like "q" or "search_query", the error goes away.

drunken monkey’s picture

Which "Filter identifier" do you mean?
And, more basic questions: is this really in the "Facets" component, and what serverice class are you using (Solr, database, …)?

Anonymous’s picture

Component: Facets » Views integration

Ok, sorry to confuse, this is in the Search Api Views, you create a view based on a solr index. Then you add a views filter, for example "Fulltext". And you expose that filter, it gives you the option to enter a custom "filter identifier". If you change it to 'query', that messes up Drupal's logic.

For example, my views page is at /books:

/books?query=Keyword, this causes an error

But
/books?my_other_identifier=Keyword, this is fine

drunken monkey’s picture

Title: Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array » "Current search" block passes query parameters wrongly
Component: Views integration » Facets
Status: Active » Fixed

Ah, OK, thanks for the clarification.

Investigating a little further, I found out that this is neither caused by the Solr backend nor by Views, but by the "Current search" block of the Facet module, which called l() with wrong parameters. Tricky bug, but easy to fix. Everything should work now in the dev version.

Thanks for pointing this out!

mgifford’s picture

I found a related error on another module http://drupal.org/node/1015564#comment-4038978

Status: Fixed » Closed (fixed)

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