Verified Commit eeb7175a authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3512254 by sayan_k_dutta, catch, smustgrave: Deprecate #type fieldgroup

parent 914ecc3f
Loading
Loading
Loading
Loading
Loading
+9 −4
Changes for core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php: 9 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -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';
@@ -114,7 +115,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    $form['#attached']['drupalSettings']['copyFieldValue']['edit-site-mail'] = ['edit-account-mail'];

    $form['site_information'] = [
      '#type' => 'fieldgroup',
      '#type' => 'fieldset',
      '#attributes' => ['class' => ['fieldgroup']],
      '#title' => $this->t('Site information'),
      '#access' => empty($install_state['config_install_path']),
    ];
@@ -146,7 +148,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    }

    $form['admin_account'] = [
      '#type' => 'fieldgroup',
      '#type' => 'fieldset',
      '#attributes' => ['class' => ['fieldgroup']],
      '#title' => $account_label,
    ];
    $form['admin_account']['account']['name'] = [
@@ -170,7 +173,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    ];

    $form['regional_settings'] = [
      '#type' => 'fieldgroup',
      '#type' => 'fieldset',
      '#attributes' => ['class' => ['fieldgroup']],
      '#title' => $this->t('Regional settings'),
      '#access' => empty($install_state['config_install_path']),
    ];
@@ -189,7 +193,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    ];

    $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']),
+13
Changes for core/lib/Drupal/Core/Render/Element/Fieldgroup.php: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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'];