hook_preprocess_fieldset seems not to be evaluated for fieldsets that use bootstrap-panel.html.twig

Created on 27 February 2019, over 6 years ago
Updated 24 June 2025, 10 days ago

I would like add the class 'panel-primary' to some (not all) panels. I tried to use hook_preprocess_fieldset to add this class but this hook seems not to work with the bootstrap theme. Is there a better or correct way of doing this?

πŸ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Templates

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine dunot

    Yep, in hook_form_alter to change attribute label/heading/title:

    $attr_name = 'attribute_size';
    if(isset($form['purchased_entity']['widget'][0]['attributes'][$attr_name])){
            $attr_title = $form['purchased_entity']['widget'][0]['attributes'][$attr]['#title'];
            $form['purchased_entity']['widget'][0]['attributes'][$attr_name]['#title']=t('Select', [], ['context' => 'attributes']).' '.$attr_title.':';
    }
    
Production build 0.71.5 2024