Loading core/lib/Drupal/Core/Field/FieldTypeCategoryManager.php +11 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,17 @@ protected function getDiscovery(): YamlDiscovery { return $this->discovery; } /** * {@inheritdoc} */ protected function alterDefinitions(&$definitions): void { parent::alterDefinitions($definitions); if (!isset($definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY])) { throw new \LogicException('Missing fallback category.'); } } /** * {@inheritdoc} */ Loading core/modules/comment/comment.module +2 −4 Original line number Diff line number Diff line Loading @@ -789,9 +789,7 @@ function comment_entity_view_display_presave(EntityViewDisplayInterface $display * Implements hook_field_type_category_info_alter(). */ function comment_field_type_category_info_alter(&$definitions) { // TRICKY: the `comment` field type belongs in the `general` category, so the // The `comment` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. if (array_key_exists(FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY, $definitions)) { $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'comment/drupal.comment-icon'; } } core/modules/datetime_range/datetime_range.module +3 −5 Original line number Diff line number Diff line Loading @@ -33,9 +33,7 @@ function datetime_range_help($route_name, RouteMatchInterface $route_match) { * Implements hook_field_type_category_info_alter(). */ function datetime_range_field_type_category_info_alter(&$definitions) { // TRICKY: the `datetime_range` field type belongs in the `general` category, // so the libraries need to be attached using an alter hook. if (array_key_exists(FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY, $definitions)) { // The `datetime_range` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'datetime_range/drupal.datetime_range-icon'; } } core/modules/link/link.module +3 −5 Original line number Diff line number Diff line Loading @@ -71,9 +71,7 @@ function template_preprocess_link_formatter_link_separate(&$variables) { * Implements hook_field_type_category_info_alter(). */ function link_field_type_category_info_alter(&$definitions) { // TRICKY: the `link` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. if (array_key_exists(FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY, $definitions)) { // The `link` field type belongs in the `general` category, so the libraries // need to be attached using an alter hook. $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'link/drupal.link-icon'; } } core/modules/media/media.module +3 −5 Original line number Diff line number Diff line Loading @@ -537,9 +537,7 @@ function media_views_query_substitutions(ViewExecutable $view) { * Implements hook_field_type_category_info_alter(). */ function media_field_type_category_info_alter(&$definitions) { // TRICKY: the `media` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. if (array_key_exists(FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY, $definitions)) { // The `media` field type belongs in the `general` category, so the libraries // need to be attached using an alter hook. $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'media/drupal.media-icon'; } } Loading
core/lib/Drupal/Core/Field/FieldTypeCategoryManager.php +11 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,17 @@ protected function getDiscovery(): YamlDiscovery { return $this->discovery; } /** * {@inheritdoc} */ protected function alterDefinitions(&$definitions): void { parent::alterDefinitions($definitions); if (!isset($definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY])) { throw new \LogicException('Missing fallback category.'); } } /** * {@inheritdoc} */ Loading
core/modules/comment/comment.module +2 −4 Original line number Diff line number Diff line Loading @@ -789,9 +789,7 @@ function comment_entity_view_display_presave(EntityViewDisplayInterface $display * Implements hook_field_type_category_info_alter(). */ function comment_field_type_category_info_alter(&$definitions) { // TRICKY: the `comment` field type belongs in the `general` category, so the // The `comment` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. if (array_key_exists(FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY, $definitions)) { $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'comment/drupal.comment-icon'; } }
core/modules/datetime_range/datetime_range.module +3 −5 Original line number Diff line number Diff line Loading @@ -33,9 +33,7 @@ function datetime_range_help($route_name, RouteMatchInterface $route_match) { * Implements hook_field_type_category_info_alter(). */ function datetime_range_field_type_category_info_alter(&$definitions) { // TRICKY: the `datetime_range` field type belongs in the `general` category, // so the libraries need to be attached using an alter hook. if (array_key_exists(FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY, $definitions)) { // The `datetime_range` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'datetime_range/drupal.datetime_range-icon'; } }
core/modules/link/link.module +3 −5 Original line number Diff line number Diff line Loading @@ -71,9 +71,7 @@ function template_preprocess_link_formatter_link_separate(&$variables) { * Implements hook_field_type_category_info_alter(). */ function link_field_type_category_info_alter(&$definitions) { // TRICKY: the `link` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. if (array_key_exists(FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY, $definitions)) { // The `link` field type belongs in the `general` category, so the libraries // need to be attached using an alter hook. $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'link/drupal.link-icon'; } }
core/modules/media/media.module +3 −5 Original line number Diff line number Diff line Loading @@ -537,9 +537,7 @@ function media_views_query_substitutions(ViewExecutable $view) { * Implements hook_field_type_category_info_alter(). */ function media_field_type_category_info_alter(&$definitions) { // TRICKY: the `media` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. if (array_key_exists(FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY, $definitions)) { // The `media` field type belongs in the `general` category, so the libraries // need to be attached using an alter hook. $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'media/drupal.media-icon'; } }