I ran into an issue when running drush sapi-i . So when I am indexing, I noticed these message(s) (using PHP7.1) :
- "Illegal string offset 'value' processor.inc:331"
it happens in :
protected function implodeTokens(array $tokens) {
$ret = array();
foreach ($tokens as $token) {
if (empty($token['value']) && !is_numeric($token['value'])) {
// Filter out empty tokens.
continue;
}
if (is_array($token['value'])) {
$ret[] = $this->implodeTokens($token['value']);
}
else {
$ret[] = $token['value'];
}
}
return implode(' ', $ret);
}
Sometimes the token just consists out of numbers/id's , example :
array(5) {
[0]=>
string(4) "1485"
[1]=>
string(4) "1599"
[2]=>
string(4) "1501"
[3]=>
string(4) "1503"
[4]=>
string(4) "1481"
}
so I have added an extra check to only process when the key 'value' exists.
Comments
Comment #2
siggy commentedAdded patch for the function implodeTokens.
I might be usefull for normalizeTokens aswell (looks similar).
Comment #3
siggy commentedComment #4
drunken monkeyThe system is certainly a bit fragile, but the way we defined our "tokens" type is that they always need to have a nested
'value'key. If they don't, the bug is not that it's not handled properly, but whatever code tokenized the text (or changed existing tokens). Can you find out where this happens for you? Do you maybe have some custom processors active, or ones from other contrib modules?Comment #5
drunken monkeyClosed due to long time without response.
Please re-open with the requested information if still relevant.