While http://api.drupal.org/api/function/search_get_keys/6 exists in Drupal 6 there is no such function in Drupal 7: http://api.drupal.org/api/function/search_get_keys/7 However, Google Analytics tries to use this for building the search keys and logging it with GA:

if (module_exists('search') && variable_get('googleanalytics_site_search', FALSE) && arg(0) == 'search' && $keys = search_get_keys()) {

Therefore if search module is enabled and GA is enabled, whitescreen ensues.

Comments

hass’s picture

Do you know how we can upgrade this code to get it working again? No idea why this function has been removed. Any new function that does the same?

gábor hojtsy’s picture

I took some time looking at the code, but could not find where was this gone and what's in place instead.

hass’s picture

Status: Active » Needs review
StatusFileSize
new1.46 KB

Quick and dirty... untested.

But the previous solution was also a bit like a hack. The main reason is there was no way to grab the search keys. Maybe we can implmement a cleaner way in D7... not sure.

hass’s picture

Tried to repro, but the Search in D7 seems to be completly broken. I cannot fire a search... I only get a browser error page Error 101 (net::ERR_CONNECTION_RESET): Unknown error.

EDIT: sh** Devel... disabled and it works.

hass’s picture

StatusFileSize
new1.64 KB

One more bug inside... and drupal_json_encode() may cause new issues here as there are extra slashes inside that haven't been there in past and I have no idea how to remove them. URL is also encoded in a wrong way... Very bad. Need to be tested very carefully. We may up cloning url() and drupal_json_encode() to make it work like it was in D6.

hass’s picture

drupal_http_build_query() seems to be the source of all encoding problems... :-(((

hass’s picture

StatusFileSize
new1.65 KB

rawurldecode() what url() have encoded.

hass’s picture

Status: Needs review » Fixed

Needs good testing, but has been committed for now.

hass’s picture

Status: Fixed » Closed (fixed)

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