the variable $words is not initialized before the below code snippet gets run in apachesolr_autocomplete_get_stopwords() if the stopwords file is empty (either no words or all comments/blank lines) then the array never gets created.

  foreach (explode("\n", $response->data) as $line) {
    if (drupal_substr($line, 0, 1) == "#") {
      continue;
    }
    if ($word = trim($line)) {
      $words[] = $word;
    }
  }
  // Cache in Drupal cache for 10 minutes.
  cache_set($cid, $words, 'cache', REQUEST_TIME + 600);
  $static_cache[$env_id] = $words;
  return $words;

This issue was fixed in the 7.x-2.x branch but needs to be fixed in 7.x-1.x. Attached is the required patch

CommentFileSizeAuthor
undefined_words.patch1.38 KBrichgerdes
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

reg98 created an issue. See original summary.

richgerdes’s picture

Status: Active » Closed (duplicate)

Sorry, Duplicate of issue #2628364

donquixote’s picture