From d6a8c639aa5708488a74da5bb394ca27920508bd Mon Sep 17 00:00:00 2001 From: Dutta-Sayan <sayan.dutta@innoraft.com> Date: Fri, 21 Mar 2025 14:42:36 +0530 Subject: [PATCH 1/5] Issue #3512254: Removed the #type fieldgroup declarations from SiteConfigureForm.php. --- core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php index 427a0999ca1e..6df7ea587c7b 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php @@ -114,7 +114,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['#attached']['drupalSettings']['copyFieldValue']['edit-site-mail'] = ['edit-account-mail']; $form['site_information'] = [ - '#type' => 'fieldgroup', '#title' => $this->t('Site information'), '#access' => empty($install_state['config_install_path']), ]; @@ -146,7 +145,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { } $form['admin_account'] = [ - '#type' => 'fieldgroup', '#title' => $account_label, ]; $form['admin_account']['account']['name'] = [ @@ -170,7 +168,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; $form['regional_settings'] = [ - '#type' => 'fieldgroup', '#title' => $this->t('Regional settings'), '#access' => empty($install_state['config_install_path']), ]; @@ -189,7 +186,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; $form['update_notifications'] = [ - '#type' => 'fieldgroup', '#title' => $this->t('Update notifications'), '#description' => $this->t('When checking for updates, your site automatically sends anonymous information to Drupal.org. See the <a href="@update-module-docs" target="_blank">Update module documentation</a> for details.', ['@update-module-docs' => 'https://www.drupal.org/node/178772']), '#access' => empty($install_state['config_install_path']), -- GitLab From 0d0d0ef60e0beac2397cc0af4315ddc940302926 Mon Sep 17 00:00:00 2001 From: Dutta-Sayan <sayan.dutta@innoraft.com> Date: Fri, 21 Mar 2025 18:01:02 +0530 Subject: [PATCH 2/5] Issue #3512254: Corrected the #type with fieldset. --- core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php index 6df7ea587c7b..6a8bfabc5dce 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php @@ -114,6 +114,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['#attached']['drupalSettings']['copyFieldValue']['edit-site-mail'] = ['edit-account-mail']; $form['site_information'] = [ + '#type' => 'fieldset', + '#attributes' => ['class' => ['fieldgroup']], '#title' => $this->t('Site information'), '#access' => empty($install_state['config_install_path']), ]; @@ -145,6 +147,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { } $form['admin_account'] = [ + '#type' => 'fieldset', + '#attributes' => ['class' => ['fieldgroup']], '#title' => $account_label, ]; $form['admin_account']['account']['name'] = [ @@ -168,6 +172,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; $form['regional_settings'] = [ + '#type' => 'fieldset', + '#attributes' => ['class' => ['fieldgroup']], '#title' => $this->t('Regional settings'), '#access' => empty($install_state['config_install_path']), ]; @@ -186,6 +192,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; $form['update_notifications'] = [ + '#type' => 'fieldset', + '#attributes' => ['class' => ['fieldgroup']], '#title' => $this->t('Update notifications'), '#description' => $this->t('When checking for updates, your site automatically sends anonymous information to Drupal.org. See the <a href="@update-module-docs" target="_blank">Update module documentation</a> for details.', ['@update-module-docs' => 'https://www.drupal.org/node/178772']), '#access' => empty($install_state['config_install_path']), -- GitLab From 327a6d55ca396a6c2c9be630139a1cfae40344b9 Mon Sep 17 00:00:00 2001 From: Dutta-Sayan <sayan.dutta@innoraft.com> Date: Tue, 25 Mar 2025 12:13:33 +0530 Subject: [PATCH 3/5] Issue: #3512254: Reverted the changes and added the @deprecated comments. --- .../Core/Installer/Form/SiteConfigureForm.php | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php index 6a8bfabc5dce..b5bceeb185ef 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php @@ -113,9 +113,11 @@ public function buildForm(array $form, FormStateInterface $form_state) { // work during installation. $form['#attached']['drupalSettings']['copyFieldValue']['edit-site-mail'] = ['edit-account-mail']; + // @deprecated The #type 'fieldgroup' is deprecated and will be removed in + // further Drupal releases. + // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['site_information'] = [ - '#type' => 'fieldset', - '#attributes' => ['class' => ['fieldgroup']], + '#type' => 'fieldgroup', '#title' => $this->t('Site information'), '#access' => empty($install_state['config_install_path']), ]; @@ -146,9 +148,11 @@ public function buildForm(array $form, FormStateInterface $form_state) { $account_label = $this->t('Site maintenance account'); } + // @deprecated The #type 'fieldgroup' is deprecated and will be removed in + // further Drupal releases. + // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['admin_account'] = [ - '#type' => 'fieldset', - '#attributes' => ['class' => ['fieldgroup']], + '#type' => 'fieldgroup', '#title' => $account_label, ]; $form['admin_account']['account']['name'] = [ @@ -171,9 +175,11 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#required' => TRUE, ]; + // @deprecated The #type 'fieldgroup' is deprecated and will be removed in + // further Drupal releases. + // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['regional_settings'] = [ - '#type' => 'fieldset', - '#attributes' => ['class' => ['fieldgroup']], + '#type' => 'fieldgroup', '#title' => $this->t('Regional settings'), '#access' => empty($install_state['config_install_path']), ]; @@ -191,9 +197,11 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#access' => empty($install_state['config_install_path']), ]; + // @deprecated The #type 'fieldgroup' is deprecated and will be removed in + // further Drupal releases. + // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['update_notifications'] = [ - '#type' => 'fieldset', - '#attributes' => ['class' => ['fieldgroup']], + '#type' => 'fieldgroup', '#title' => $this->t('Update notifications'), '#description' => $this->t('When checking for updates, your site automatically sends anonymous information to Drupal.org. See the <a href="@update-module-docs" target="_blank">Update module documentation</a> for details.', ['@update-module-docs' => 'https://www.drupal.org/node/178772']), '#access' => empty($install_state['config_install_path']), -- GitLab From 255270b01825f68e5513d06039b620400a70e2b0 Mon Sep 17 00:00:00 2001 From: Dutta-Sayan <sayan.dutta@innoraft.com> Date: Tue, 25 Mar 2025 13:00:03 +0530 Subject: [PATCH 4/5] Issue: #3512254: Added the drupal version in deprecation comments. --- .../Core/Installer/Form/SiteConfigureForm.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php index b5bceeb185ef..ddec96e6ae59 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php @@ -113,8 +113,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { // work during installation. $form['#attached']['drupalSettings']['copyFieldValue']['edit-site-mail'] = ['edit-account-mail']; - // @deprecated The #type 'fieldgroup' is deprecated and will be removed in - // further Drupal releases. + // @deprecated The #type 'fieldgroup' is deprecated in drupal:11.2.0 and is + // removed from drupal:12.0.0. // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['site_information'] = [ '#type' => 'fieldgroup', @@ -148,8 +148,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { $account_label = $this->t('Site maintenance account'); } - // @deprecated The #type 'fieldgroup' is deprecated and will be removed in - // further Drupal releases. + // @deprecated The #type 'fieldgroup' is deprecated in drupal:11.2.0 and is + // removed from drupal:12.0.0. // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['admin_account'] = [ '#type' => 'fieldgroup', @@ -175,8 +175,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#required' => TRUE, ]; - // @deprecated The #type 'fieldgroup' is deprecated and will be removed in - // further Drupal releases. + // @deprecated The #type 'fieldgroup' is deprecated in drupal:11.2.0 and is + // removed from drupal:12.0.0. // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['regional_settings'] = [ '#type' => 'fieldgroup', @@ -197,8 +197,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#access' => empty($install_state['config_install_path']), ]; - // @deprecated The #type 'fieldgroup' is deprecated and will be removed in - // further Drupal releases. + // @deprecated The #type 'fieldgroup' is deprecated in drupal:11.2.0 and is + // removed from drupal:12.0.0. // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['update_notifications'] = [ '#type' => 'fieldgroup', -- GitLab From c249218b6fdf7ecd0124ac30b8a256ac89659459 Mon Sep 17 00:00:00 2001 From: Dutta-Sayan <sayan.dutta@innoraft.com> Date: Tue, 25 Mar 2025 16:27:40 +0530 Subject: [PATCH 5/5] Issue #3512254: Added the deprication in Fieldgroup class and made the changes iin SiteCconfigureForm. --- .../Core/Installer/Form/SiteConfigureForm.php | 25 +++++++------------ .../Drupal/Core/Render/Element/Fieldgroup.php | 13 ++++++++++ 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php index ddec96e6ae59..2f58ba168afa 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php @@ -106,6 +106,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { ])); } + $form['#attached']['library'][] = 'core/drupal.fieldgroup'; $form['#attached']['library'][] = 'system/drupal.system'; // Add JavaScript time zone detection. $form['#attached']['library'][] = 'core/drupal.timezone'; @@ -113,11 +114,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { // work during installation. $form['#attached']['drupalSettings']['copyFieldValue']['edit-site-mail'] = ['edit-account-mail']; - // @deprecated The #type 'fieldgroup' is deprecated in drupal:11.2.0 and is - // removed from drupal:12.0.0. - // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['site_information'] = [ - '#type' => 'fieldgroup', + '#type' => 'fieldset', + '#attributes' => ['class' => ['fieldgroup']], '#title' => $this->t('Site information'), '#access' => empty($install_state['config_install_path']), ]; @@ -148,11 +147,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { $account_label = $this->t('Site maintenance account'); } - // @deprecated The #type 'fieldgroup' is deprecated in drupal:11.2.0 and is - // removed from drupal:12.0.0. - // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['admin_account'] = [ - '#type' => 'fieldgroup', + '#type' => 'fieldset', + '#attributes' => ['class' => ['fieldgroup']], '#title' => $account_label, ]; $form['admin_account']['account']['name'] = [ @@ -175,11 +172,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#required' => TRUE, ]; - // @deprecated The #type 'fieldgroup' is deprecated in drupal:11.2.0 and is - // removed from drupal:12.0.0. - // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['regional_settings'] = [ - '#type' => 'fieldgroup', + '#type' => 'fieldset', + '#attributes' => ['class' => ['fieldgroup']], '#title' => $this->t('Regional settings'), '#access' => empty($install_state['config_install_path']), ]; @@ -197,11 +192,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#access' => empty($install_state['config_install_path']), ]; - // @deprecated The #type 'fieldgroup' is deprecated in drupal:11.2.0 and is - // removed from drupal:12.0.0. - // @todo Use #type 'fieldset' and add fieldgroup as class attribute instead. $form['update_notifications'] = [ - '#type' => 'fieldgroup', + '#type' => 'fieldset', + '#attributes' => ['class' => ['fieldgroup']], '#title' => $this->t('Update notifications'), '#description' => $this->t('When checking for updates, your site automatically sends anonymous information to Drupal.org. See the <a href="@update-module-docs" target="_blank">Update module documentation</a> for details.', ['@update-module-docs' => 'https://www.drupal.org/node/178772']), '#access' => empty($install_state['config_install_path']), diff --git a/core/lib/Drupal/Core/Render/Element/Fieldgroup.php b/core/lib/Drupal/Core/Render/Element/Fieldgroup.php index 28ca74b46015..cb84b16f8534 100644 --- a/core/lib/Drupal/Core/Render/Element/Fieldgroup.php +++ b/core/lib/Drupal/Core/Render/Element/Fieldgroup.php @@ -15,10 +15,23 @@ * * @see \Drupal\Core\Render\Element\Fieldset * @see \Drupal\Core\Render\Element\Details + * + * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. + * Use \Drupal\Core\Render\Element\Fieldset instead. + * + * @see https://www.drupal.org/node/3515272 */ #[RenderElement('fieldgroup')] class Fieldgroup extends Fieldset { + /** + * {@inheritdoc} + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + @trigger_error('The ' . __CLASS__ . ' element is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use ' . Fieldset::class . ' instead. See https://www.drupal.org/node/3515272', E_USER_DEPRECATED); + } + public function getInfo() { $info = parent::getInfo(); $info['#attributes']['class'] = ['fieldgroup']; -- GitLab