diff --git a/core/core.libraries.yml b/core/core.libraries.yml index ee5987c51685363b7dab47ef09fc543b2a5fe6d5..770bcf7c9ec9376d2960d1c83bdda58c804d31c9 100644 --- a/core/core.libraries.yml +++ b/core/core.libraries.yml @@ -589,6 +589,21 @@ drupal.entity-form: dependencies: - core/drupal.form +drupal.fieldgroup: + version: VERSION + css: + component: + misc/components/fieldgroup.module.css: { weight: -10 } + moved_files: + system/base: + deprecation_version: 11.2.0 + removed_version: 12.0.0 + deprecation_link: https://www.drupal.org/node/3432346 + css: + component: + css/components/fieldgroup.module.css: + base: core/misc/components/fieldgroup.module.css + drupal.form: version: VERSION js: diff --git a/core/lib/Drupal/Core/Render/Element/Fieldgroup.php b/core/lib/Drupal/Core/Render/Element/Fieldgroup.php index 9958645197cee9d706e0eda51bff400bb2d6803c..28ca74b46015cb74360a7b26f37e4711edca6d8c 100644 --- a/core/lib/Drupal/Core/Render/Element/Fieldgroup.php +++ b/core/lib/Drupal/Core/Render/Element/Fieldgroup.php @@ -20,9 +20,18 @@ class Fieldgroup extends Fieldset { public function getInfo() { - return [ - '#attributes' => ['class' => ['fieldgroup']], - ] + parent::getInfo(); + $info = parent::getInfo(); + $info['#attributes']['class'] = ['fieldgroup']; + $info['#pre_render'][] = [static::class, 'preRenderAttachments']; + return $info; + } + + /** + * Adds the fieldgroup library. + */ + public static function preRenderAttachments($element): array { + $element['#attached']['library'][] = 'core/drupal.fieldgroup'; + return $element; } } diff --git a/core/modules/system/css/components/fieldgroup.module.css b/core/misc/components/fieldgroup.module.css similarity index 100% rename from core/modules/system/css/components/fieldgroup.module.css rename to core/misc/components/fieldgroup.module.css diff --git a/core/modules/system/system.libraries.yml b/core/modules/system/system.libraries.yml index 3f3c00951be0a2a8b3881e4a71be6dd439f77d06..12017369189e40dbf4e5692d5913f59e2f7fe855 100644 --- a/core/modules/system/system.libraries.yml +++ b/core/modules/system/system.libraries.yml @@ -4,7 +4,6 @@ base: # Adjust the weights to load these early. component: css/components/align.module.css: { weight: -10 } - css/components/fieldgroup.module.css: { weight: -10 } css/components/container-inline.module.css: { weight: -10 } css/components/clearfix.module.css: { weight: -10 } css/components/details.module.css: { weight: -10 } diff --git a/core/themes/stable9/css/system/components/fieldgroup.module.css b/core/themes/stable9/css/core/components/fieldgroup.module.css similarity index 100% rename from core/themes/stable9/css/system/components/fieldgroup.module.css rename to core/themes/stable9/css/core/components/fieldgroup.module.css diff --git a/core/themes/stable9/stable9.info.yml b/core/themes/stable9/stable9.info.yml index 745ceffab0409434447cb7d87129cc8758b9f989..a8fb889436a9562293c4edf04e6a2b9426a24984 100644 --- a/core/themes/stable9/stable9.info.yml +++ b/core/themes/stable9/stable9.info.yml @@ -68,6 +68,11 @@ libraries-override: component: misc/dropbutton/dropbutton.css: css/core/dropbutton/dropbutton.css + core/drupal.fieldgroup: + css: + component: + misc/components/fieldgroup.module.css: css/core/components/fieldgroup.module.css + core/drupal.progress: css: component: @@ -220,7 +225,6 @@ libraries-override: css: component: css/components/align.module.css: css/system/components/align.module.css - css/components/fieldgroup.module.css: css/system/components/fieldgroup.module.css css/components/container-inline.module.css: css/system/components/container-inline.module.css css/components/clearfix.module.css: css/system/components/clearfix.module.css css/components/details.module.css: css/system/components/details.module.css