Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
];
Comment | File | Size | Author |
---|---|---|---|
#11 | theme-settings.patch | 433 bytes | anthony.bouch |
#8 | theme-settings.patch | 2.29 KB | anthony.bouch |
Comments
Comment #2
joelpittet@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 isFALSE
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?
Comment #3
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commented@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 ;-)
Comment #4
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedAttached. 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.
Comment #5
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedAttached again, with what I hope are helpful changes.
Comment #6
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedComment #7
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedComment #8
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commented3rd time lucky....
Comment #9
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedSheesh - 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
Comment #10
joelpittetSorry 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.
Comment #11
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedOkay understood - and all a little simpler after a good night's sleep :-) Also thanks for the coding standards tip.
Attached.
Comment #13
joelpittetThank @blue_waters, I've committed it to the 8.x-1.x-dev branch.