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.
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
Comment | File | Size | Author |
---|---|---|---|
undefined_words.patch | 1.38 KB | richgerdes |
Comments
Comment #2
richgerdesSorry, Duplicate of issue #2628364
Comment #3
donquixote CreditAttribution: donquixote as a volunteer commented