By cs_shadow on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
8.x
Introduced in version:
8.x
Issue links:
Description:
The $format_id parameter to check_markup() was optional, even though the calling code must always know the text format in which the user has provided input. Hence, $format_id is now a required attribute. Although, it is still allowed to explicitly pass NULL as the $format_id to use the fallback format in edge-case scenarios.
Before:
$filtered_text = check_markup($text);
After:
$filtered_text = check_markup($text, 'filtered_html');
// or
$filtered_text = check_markup($text, 'full_html');
// or, in general:
$filtered_text = check_markup($text, '<your text format name>');
The $langcode parameter used to default to the empty string, even though there is a language code specifically for indicating the language is unknown. Hence, $langcode now defaults to Drupal\Core\Language\LanguageInterface::LANGCODE_NOT_SPECIFIED, so text is always processed with a proper language code.
Impacts:
Module developers