Fieldset has been replaced by Details in Drupal 8 - which includes support for 'open' (formerly collapsable)

I.e.

  $form['options_settings'] = [
    '#type' => 'fieldset',
    '#title' => t('Theme Specific Settings'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  ];

Should now be....

  $form['options_settings'] = [
    '#type' => 'details',
    '#title' => t('Theme Specific Settings'),
   '#description' => t('Select the theme specific settings.'),
    '#open' => TRUE, // Controls the HTML5 'open' attribute. Defaults to FALSE.
  ];
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blue_waters created an issue. See original summary.

joelpittet’s picture

@blue_waters thank you for the report, you are half right there. It's replaced outright, we still have fieldsets but no long are they collapsible/collapsed. You can see both collapsed and collapsible is FALSE therefore it should be a normal 'fieldset'. Those options just need to be removed as they are leftover cruft.

Could you make a patch with the cleanup for the leftover properties?

anthony.bouch’s picture

@joelpittet sure - so you basically want to keep the fieldset and remove the no longer needed collapse properties? Or do you want to turn the overarching groups for options into details, with '#open' => TRUE or FALSE?

Also I'd be supper grateful for pointers on how to submit a patch here. If it was a straight PR via Github I would have done that first ;-)

anthony.bouch’s picture

FileSize
593 bytes

Attached. Sigh - it's 1:25am here and I'm bushed. There's a typo in the patch. Will send again (and I have no idea how to delete a comment or remove a submitted patch from this thread.

anthony.bouch’s picture

FileSize
3.73 KB

Attached again, with what I hope are helpful changes.

anthony.bouch’s picture

anthony.bouch’s picture

anthony.bouch’s picture

FileSize
2.29 KB

3rd time lucky....

anthony.bouch’s picture

Sheesh - so much for my first patch experience at Drupal.org. It's not exactly smooth - although I think understand why it's important to keep the repositories and community here in one place.

Anyway - hope this helps. I'll wait until I'm a little fresher before posting a patch for html.html.twig

joelpittet’s picture

Sorry for the delayed response. It looks like you've got a patch. I was hoping to just keep the fieldset and remove the collapse as that was the original intent by the FALSE/FALSE it looks like.

The patch seems to look like you got the hang of it. Don't need some of the other changes in there. Our coding standards leave all array items on multiple lines with a trailing comma for PHP.

Just need to remove the #collapsible and #collapsed properties I suspect, unless there is more cleanup you think needed around fieldsets? Just letting you do it and give you the commit credit and patch experience.

anthony.bouch’s picture

FileSize
433 bytes

Okay understood - and all a little simpler after a good night's sleep :-) Also thanks for the coding standards tip.

Attached.

joelpittet’s picture

Status: Active » Fixed

Thank @blue_waters, I've committed it to the 8.x-1.x-dev branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.