- Merge request !18Issue #3549199 by gaddman, mingsong: No description causes deprecation warning → (Merged) created by mingsong
After updating from 2.2.0 to 2.2.1 I see the following errors when a page is first loaded after clearing caches:
Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Unicode::validateUtf8() (line 395 of core/lib/Drupal/Component/Utility/Unicode.php).
Drupal\Component\Utility\Unicode::validateUtf8() (Line: 65)
Drupal\Component\Utility\Xss::filter() (Line: 366)
Drupal\tooltip_taxonomy\Services\TooltipManager->addVocabularyReplacement() (Line: 249)
Drupal\tooltip_taxonomy\Services\TooltipManager->addTooltip() (Line: 71)
tooltip_taxonomy_entity_display_build_alter() (Line: 552)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 289)
<snip>
The error is present for every taxonomy term that has no description. Looks like it's caused by this change in MR17:
From:
$des = strip_tags($term->get('description')->value, $allowed_html_tags);
To:
$des = Xss::filter($term->get('description')->value, $allowed_tags_array);
Check for description first, eg, add this before the Xss::filter line:
if ($term->get('description')->isEmpty()) {
continue;
}
Active
2.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.