Problem/Motivation

Add support for Bootstrap 5.

Proposed resolution

Different templates for different version of BS.

User interface changes

Add '5' to setting.

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ckng created an issue. See original summary.

ckng’s picture

Status: Active » Needs review

See merge request.

  • ckng authored 99cd0f0 on 8.x-2.x
    Issue #3216063 by ckng: Bootstrap 5 support
    
labboy0276’s picture

Title: Bootstrap 5 support » Bootstrap 5 support for 8.x-1.x
Version: 8.x-2.x-dev » 8.x-1.x-dev
Status: Needs review » Active

Thanks, I pushed up and tagged a new release for 8.x-2.x.

I will change the issue to remind someone to do it for 8.x-1.x as well.

jacobbell84’s picture

Is there supposed to be an updated view to go along with this? We updated one of our sites from 2.0-beta7 to beta9 and it's throwing the following error on page loads (if you have an active alert):

Error: Call to a member function __toString() on null in bootstrap_site_alert_preprocess_views_view_fields() (line 134 of modules\contrib\bootstrap_site_alert\bootstrap_site_alert.module).

That area of code is controlling the new template logic

      $vars['output'] = [
        '#theme' => 'bs_site_alert_' . ($version == '5' ?  '5' : '4'),
        '#message' => $fields['rendered_entity']->content->__toString(),
        '#level' => $level,
        '#close' => $fields['field_bs_alert_dismiss']->content->__toString(),
      ];

It seems like it's looking for a "rendered_entity" field that doesn't exist on our site. I checked the module's view config yaml and didn't notice any changes there.

  • labboy0276 committed 26e4a6d on 8.x-2.x
    Issue #3216063 by labboy0276: Bootstrap 5 support for 8.x-1.x
    
labboy0276’s picture

@jacobbell84 thanks for bringing this to my attention. I just pushed up beta10 that fixes the critical issue.

ckng’s picture

Status: Active » Needs review

Right, because on my end I changed to use rendered entity.

jacobbell84’s picture

Great, thank you for the quick turnaround!

labboy0276’s picture

Status: Needs review » Needs work

Still needs to have the code applied to the 8.x-1.x version