$title being empty, when t($title), returns a big array,

so the search results has as a title 'Array'

also maybe tt() should be used if translating variable.

For now, made a quick fix.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

coderintherye’s picture

FileSize
619 bytes

+1 For this. I was also getting this error. The proper way to use t is to escape the variables, as shown at http://api.drupal.org/api/drupal/includes--common.inc/function/t/6

So here is a patch which does that.

coderintherye’s picture

On a side note, the reason I saw "array" was because $title was getting passed as NULL. Presumably from:


function google_appliance_search_view($search_base, $client, $collection, $keys = NULL, $title = NULL) {
  $form = drupal_get_form('google_appliance_search_form', NULL, $search_base, $client, $collection, $keys);
  // When POSTing back to an existing search-results page, the original
  // URL is accessed (which re-runs that search) and then the redirect for
  // the new search takes place and a second (correct) search is executed.
  // We can avoid this issue in the same manner as search_view()
  if (!isset($_POST['form_id'])) {
    $search_view = array(
      'client' => $client,
      'collection' => $collection,
      'keys' => $keys,
      'search_base' => $search_base,
      'form' => $form,
      'results' => google_appliance_search('search', $keys, array(), $collection, $client),
      // google_appliance_cache_data() depends upon google_appliance_search()
      'keymatches' => google_appliance_cache_data('keymatches'),
      'synonyms' => google_appliance_cache_data('synonyms'),
    );
    return theme('google_appliance_search_view', $search_view, $title);
  }
  else {
    return $form;
  }
}

Might be nice to add into the theme function that if $title is NULL to set it to 'Search results'. This is in the function declaration, but you have already declared it as NULL prior so it seems to stay as NULL when passed to the theme function.

lambic’s picture

Patch works for me