@@ -439,6 +439,9 @@ function drupal_static_reset($name = NULL): void {
}
break;
case'filter_formats':
@trigger_error("Using drupal_static_reset() with 'filter_formats' as argument is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. No replacement is provided. See https://www.drupal.org/node/3035368",E_USER_DEPRECATED);
@trigger_error(__FUNCTION__.'() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the Drupal\filter\FilterFormatRepositoryInterface service with the ::getAllFormats() method to get all formats, or with the ::getFormatsForAccount() method to get all formats that a user is able to access. See https://www.drupal.org/node/3035368',E_USER_DEPRECATED);
* @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Invalidate
* 'filter_formats' entity type list cache tags instead.
*
* @see https://www.drupal.org/node/3035368
*/
functionfilter_formats_reset():void{
drupal_static_reset('filter_formats');
@trigger_error(__FUNCTION__."() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Invalidate 'filter_formats' entity type list cache tags instead. See https://www.drupal.org/node/3035368",E_USER_DEPRECATED);
@trigger_error('filter_get_roles_by_format() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the \Drupal\filter\FilterFormatInterface::getRoles() method instead. See https://www.drupal.org/node/3035368',E_USER_DEPRECATED);
return$format->getRoles();
}
/**
@@ -104,16 +85,16 @@ function filter_get_roles_by_format(FilterFormatInterface $format): array {
* @return \Drupal\filter\FilterFormatInterface[]
* An array of text format objects that are allowed for the role, keyed by
* the text format ID and ordered by weight.
*
* @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the
* \Drupal\filter\FilterFormatRepositoryInterface service with the
* ::getFormatsByRole() method instead.
*
* @see https://www.drupal.org/node/3035368
*/
functionfilter_get_formats_by_role($rid):array{
$formats=[];
foreach(filter_formats()as$format){
$roles=filter_get_roles_by_format($format);
if(isset($roles[$rid])){
$formats[$format->id()]=$format;
}
}
return$formats;
@trigger_error('filter_get_formats_by_role() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the Drupal\filter\FilterFormatRepositoryInterface service with the ::getFormatsByRole() method instead. See https://www.drupal.org/node/3035368',E_USER_DEPRECATED);
// Get a list of formats for this user, ordered by weight. The first one
// available is the user's default format.
$formats=filter_formats($account);
$format=reset($formats);
return$format->id();
@trigger_error('filter_default_format() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the Drupal\filter\FilterFormatRepositoryInterface service with the ::getDefaultFormat() method instead. See https://www.drupal.org/node/3035368',E_USER_DEPRECATED);
@trigger_error('filter_fallback_format() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the Drupal\filter\FilterFormatRepositoryInterface service with the ::getFallbackFormatId() method instead. See https://www.drupal.org/node/3035368',E_USER_DEPRECATED);
@@ -265,7 +243,7 @@ function _filter_tips($format_id): array {
@trigger_error('The $long argument to _filter_tips() is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Only short tips are used. See https://www.drupal.org/node/3567879',E_USER_DEPRECATED);
}
@trigger_error(__FUNCTION__.'() is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3566774',E_USER_DEPRECATED);