Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedHi, 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.
Comment #2
drunken monkeyWhich "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, …)?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedOk, 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
Comment #4
drunken monkeyAh, 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!
Comment #5
mgiffordI found a related error on another module http://drupal.org/node/1015564#comment-4038978