Needs work
Project:
Drupal core
Version:
main
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2013 at 18:29 UTC
Updated:
21 Feb 2023 at 22:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ericduran commentedWorking on this.
Comment #2
ericduran commentedThis patch piggy backs on the work from #2041825: Remove theme_radios() and call theme('container') instead.
Once that gets in this is the only change requires.
Comment #4
manuel garcia commented#2152201: Convert theme_checkboxes() to Twig just got in, so theme_checkboxes is history. We are now using template_preprocess_checkboxes & core/modules/system/templates/checkboxes.html.twig
Attached a patch that removes the preprocess function and the twig file, and changes its #theme_wrappers to container.
Comment #6
manuel garcia commentedI believe we are loosing one css class
form-checkboxeson this move towards using container.To restore it we should add:
$element['#attributes']['class'][] = 'form-'. $element['#type'];to template_preprocess_container (within the// Special handling for form elements.chunk).Otherwise we could also add it within
form_pre_render_checkbox($element)function I suppose. However I believe adding it for every form element using container is a better approach.Comment #8
joelpittetI don't know for sure if this will work but, maybe you can set the theme_wrapper to 'container__checkboxes' and if the suggestions work with the preprocess functions you should be able to do template_preprocess_container__checkboxes to add in those extra classes.
Though that may need this:
#939462: Specific preprocess functions for theme hook suggestions are not invoked
Comment #9
mitokens commentedComment #10
andriyun commentedComment #11
andypostComment #12
manuel garcia commentedRerolled and added the css class back in template_preprocess_container__checkboxes as per suggestion on #8.
Comment #14
manuel garcia commentedWell I don't know why those tests are failing, markup looks identical before and after...
Comment #15
manuel garcia commentedActualy, before:
After:
Comment #16
manuel garcia commentedOh g... my last two comments were meant to be for #2041825: Remove theme_radios() and call theme('container') instead
Comment #17
star-szrMy comment from #2041825-22: Remove theme_radios() and call theme('container') instead applies here as well.
Comment #32
andypostre-roll for 10.1
Comment #33
andypostfix for specific preprocess
Comment #34
smustgrave commentedDidn't review yet
But seems there are failures in #33
Comment #35
andypostYes, 3 failed tests but results are not returned