Problem/Motivation

D11 compatibility is here.

Ok, so here's the steps to get Bootstrap working with D11:

Install the latest Drupal 11

  • mkdir web/themes/contrib
  • cd web/themes/contrib
  • git clone git@git.drupal.org:project/bootstrap.git
  • git fetch "git@git.drupal.org:issue/bootstrap-3428283.git" 'project-update-bot-only'
  • git checkout -b 'bootstrap-3428283-project-update-bot-only' FETCH_HEAD
  • install the bootstrap theme from the web ui
  • Go to bootstrap settings /admin/appearance/settings/bootstrap
  • look for the CDN settings
  • Change the provider to "Custom"
  • review the Custom URLs, place these ones in if they're not correct.
    https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap.css
    https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap-theme.css
    https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/js/bootstrap.js
    

    Bootstrap settings in D11.0.3

  1. hit the apply button
  2. press save configuration

D11.0.3 with Bootstrap

Remaining tasks

What has been done so far:

  • We forked "twbs/bootstrap" into "entreprise7pro/bootstrap" DONE
  • We removed IE support from entrepreprise7pro.ca/bootstrap DONE
  • We upgraded this new bootstrap to be compatible with jQuery 4 DONE
  • We fixed CVE-2024-6485 DONE
  • We successfully tested Drupal 11 which brings jQuery 4 and this new bootstrap with custom cdn provider as described above TESTED
  • cdns are available now
  • Stood up documentation site https://bootstrap.7pro.ca DONE

What is left todo:

  • Complete the fork of bootstrap-sass. Some folks using bootstrap 3 may also need bootstrap-sass (this shouldn't take very long to complete but isn't yet completed) - Assigned this task to myself joseph.olstad IN PROGRESS
  • Update the other cdn providers so that when using Drupal 11 will offer one of the stable jQuery4 compatible entreprise7pro/bootstrap releases. (Currently only custom cdn is working, it would be nice if the others worked with the new bootstrap library when running Drupal 11. I'm suggesting core version detection in the project code where we check for minimum D11 and handle this gracefully in the solution. This task is ready to be worked on now. @TODO
  • Complete these items, test everything thoroughly and then when satisfied merge the above merge request and tag a new D11 compatible 3x release. @PENDING

Issue fork bootstrap-3428283

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

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new2.51 KB

This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request is also openend and updated.

It is important that any automated tests available are run and that you manually test the changes.

Drupal 11 Compatibility

According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 11.

Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.

Therefore these changes did not update the info.yml file for Drupal 11 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

Debug info

Bot run #11-120024

This patch was created using these packages:

  1. drupal/upgrade_status: 4.1.0
  2. mglaman/phpstan-drupal: 1.2.7
  3. palantirnet/drupal-rector: 0.20.1

project update bot’s picture

Version: 8.x-3.30 » 8.x-3.x-dev
StatusFileSize
new0 bytes
new2.51 KB
new15.4 KB

This comment was forced and has ignored the check if a change was already posted. This is only done when we want to update the issue without waiting for changes to happen.

This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

It is important that any automated tests available are run and that you manually test the changes.

Drupal 11 Compatibility

According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 11.

Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.

Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

Debug information

Bot run #11-137198

These packages were used to generate the fixes:

  1. drupal/upgrade_status: 4.1.0
  2. mglaman/phpstan-drupal: 1.2.10
  3. palantirnet/drupal-rector: 0.20.1
project update bot’s picture

This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

It is important that any automated tests available are run and that you manually test the changes.

Drupal 11 Compatibility

According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 11.

Currently Drupal Rector, version 0.20.2, cannot fix all Drupal 11 compatibility problems.

Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

Debug information

Bot run #11-188138

These packages were used to generate the fixes:

  1. drupal/upgrade_status: 4.3.2
  2. mglaman/phpstan-drupal: 1.2.11
  3. palantirnet/drupal-rector: 0.20.2

project update bot’s picture

This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

It is important that any automated tests available are run and that you manually test the changes.

Drupal 11 Compatibility

According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 11.

Currently Drupal Rector, version 0.20.3, cannot fix all Drupal 11 compatibility problems.

Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

Debug information

Bot run #11-199781

These packages were used to generate the fixes:

  1. drupal/upgrade_status: 4.3.2
  2. mglaman/phpstan-drupal: 1.2.11
  3. palantirnet/drupal-rector: 0.20.3

jcnventura changed the visibility of the branch 3428283-automated-drupal-11 to hidden.

jcnventura changed the visibility of the branch 3428283-automated-drupal-11 to hidden.

jcnventura’s picture

Issue summary: View changes
Status: Needs review » Postponed

This makes the theme work under Drupal 11, but then comes the next problem:

Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4

Drupal 11 has upgraded jQuery to 4.0.0-beta, and Bootstrap 3 doesn't support this version. This is effectively the end-of-line for Bootstrap 3, and until this theme finds a way to support Bootstrap 5, it will not be possible to add Drupal 11 support.

shelane’s picture

This theme is not going to support Bootstrap 5. There are other themes that do.

jcnventura’s picture

Understood, and totally respect your decision. Everyone has now 2 years to migrate away from this theme, as it will be EoL at the same time as Drupal 10.

Any tips on which of the existing Bootstrap 5 themes is the easiest to upgrade to?

shelane’s picture

Other themes are listed on the project page. We are currently working on getting our theme updated to use Radix as a base theme. Version 6 makes use of core SDC, which really works for us.

joseph.olstad’s picture

Status: Postponed » Active

reviewing

joseph.olstad’s picture

It was mentioned in 2016 that Bootstrap 3 would not be compatible with jQuery 3, however it is currently compatible with jQuery 3.7.x.

Let's keep this open to see what work comes out of this. Perhaps a fork to bootstrap 3.x js library will resolve this?

Or, perhaps we can override D11 core for the front-end theme and force it to use jQuery 3 instead of 4?

With that said, would prefer a version of bootstrap 3x compatible with jQuery 4 as that'd probably be the easier way to go.

joseph.olstad’s picture

https://github.com/twbs/bootstrap/issues/40701

I have openned an upstream issue with the twbs bootstrap project

I imagine they may laugh at us but we'll see if any helpful suggestions come out of this.

joseph.olstad’s picture

Our most likely D11 compatible option is to fork twbs bootstrap according to these instructions:

https://github.com/twbs/bootstrap/issues/40701

and upgrade the fork to support jQuery 4

xem8vfdh’s picture

thank you everyone for working on this :)

joseph.olstad’s picture

Conversed in slack with a core maintainer and he just suggested to try dropping in jQuery 4 to see what happens. jQuery 4 is mostly backwards compatible except pertaining to some legacy browser support.

joseph.olstad’s picture

@jcnventura , you mentioned/claimed above in comment #12 that bootstrap 3.4.x is not compatible with jQuery 4, however have you actually proven/tested jQuery 4 with bootstrap 3.4.x to be incompatible?

During a slack chat with a drupal core maintainer he suggested testing bootstrap 3.4.x with jQuery 4 it as it "might" already be compatible with jQuery 4.

Apparently jQuery 4 is very compatible with jQuery 3, most of the deprecations are related to legacy browser support for browsers such as IE11 and older browsers.

It may actually prove to be a fairly small effort to get things going with jQuery 4.

Step 1

  • Remove all conditional css entries in our twig files, these are no longer needed as IE9/IE10/IE11 are no longer relevant. This can be done now.

Step 2

  • Search for any IE9/IE10/IE11 javascript code in this project javascript, if there is any, remove/replace/refactor carefully.

Step 3

  • Upgrade bootstrap 3 module for Drupal 11

Step 4

  • Apply related patches/build and use that version of bootstrap/bootstrap 3.4.x and install it on Drupal 10.3.x/Drupal 11 with jQuery 4 running

Step 5

  • Take inventory of any known/found javascript errors, put them into a ticket and link that ticket to this issue.

Step 6

  • Take inventory of any known/found php/Drupal errors, put them into a ticket and link that ticket to this issue.
klemendev’s picture

Here is a full list of changes in jQuery 4: https://blog.jquery.com/2024/02/06/jquery-4-0-0-beta/

Maybe it is doable, maybe even this module could provide own fork of JS files of bootstrap

jcnventura’s picture

@joseph.olstad in #10 was the point where I got this theme to work in Drupal 11. The upstream bootstrap code has a test early on that checks for the version of jQuery being used. If it detects jQuery 4, it throws an error and refuses to run.

My efforts stopped at that point, as asking a Drupal theme maintainer to co-maintain Bootstrap 3 is simply too much to ask (even if it is maintaining a patch and not the full library, I think it will eventually become the full library).

We have 2 years to migrate away from Bootstrap 3. I think the best solution here would be a tutorial on the best way to migrate from this theme to another of the Bootstrap 5-based themes.

joseph.olstad’s picture

Ok, thanks for that @jcnventura.

We'll 100% for sure have to fork twbs bootstrap and remove that version check and any IE11/IE10 specific js code, should be a fairly easy task.

Suggest that we add a contrib module , example, call it bootstrap3, in there would be the build sources and compile instructions, this is where we'd have the new version of bootstrap and it would generate an optimized min js that we'll consume and add as a dependency for use by the bootstrap theme.

Some refactoring involved, I am imagining that this is 100% do-able.

The radix theme actually includes bootstrap sources in it's builds and expects people to compile them (really ugly in the wild, I've seen what clients do with it), we could do something similar to what radix does but I think to align with how we've been doing things for years and to avoid hacks (radix can get messy), I'm suggesting putting it in a support module called bootstrap3 (for example).

jcnventura’s picture

The jQuery 4 compatible version of Bootstrap should not be a Drupal extension at all. It should probably be in GitHub and a simply be a fork of the existing sources.

joseph.olstad’s picture

@jncventura, perhaps I'm missing something however radix is already doing something similar to what I'm suggesting we do. With that said, there's maybe a manual step that the radix project does. The Bootstrap license is an MIT License, which afaik, is compatible with Drupal licensing. Perhaps there's a nuance I'm missing here?

whatever is easiest, I suppose simply forking twbs bootstrap could be the easiest way forward and would align with what this drupal project called bootstrap has been relying on for some time now.

xem8vfdh’s picture

I'm not fully following the discussion here, but if it is possible to make this module D11 compatible, that would be greatly appreciated. Migrating to Bootstrap 5 would be a momentous task.

joseph.olstad’s picture

I'm working on a 3x fork, the main branch is the v4/v5 stuff, v3-dev is the 3x dev branch, I've set v3-dev as the main branch
Fork is here:
https://github.com/entreprise7pro/bootstrap

jcnventura’s picture

@joseph.olstad in #23 (which is weirdly unpublished), you suggested to fork twbs/bootstrap and have the build method be a Drupal method. You should be fine with just adding GitHub Actions to the fork you just did in GitHub to generate the minified Javascript libraries. Then, the only change would be to the libraries.yml of this theme to fetch the libraries from GitHub.

There's zero need to create a Drupal module when the code you forked does not use any part of Drupal.

xem8vfdh’s picture

avoiding an unnecessary drupal module/module-fork would be good.

If this module shifts from depending on and installing the original Bootstrap JS package towards depending on and installing the fork linked above, I think this should be documented and explained with thorough detail on the module home page... why it is that we needed to fork, whose behind "enterprise7pro", etc.

joseph.olstad’s picture

Ok I've spent some time on the fork, upgraded bootstraps javascript to accept jQuery 4. I removed and cleaned up all the microsoft IE support from the entire branch. I am able to compile all of this, it is compiling and I have compiled it and pushed it up and made a github release of bootstrap and called it v3-dev-3
the actual release once it's tested and people are happy with it will be 3.4.2

Here's the zip file you can try out, with the dist folder has the compiled js and css
https://github.com/entreprise7pro/bootstrap/archive/refs/tags/v3-dev-3.zip

There's also the same thing in tar.gz
https://github.com/entreprise7pro/bootstrap/archive/refs/tags/v3-dev-3.t...

Hi @jncventura, ok, do you have a github account? Perhaps I can grant you admin access to my fork.
BTW
https://github.com/entreprise7pro/bootstrap/archive/refs/tags/v3-dev-3.zip

I appreciate folks helping to review this build of bootstrap against Drupal 11.

Thanks

joseph.olstad’s picture

I've figured out how the cdn works, but I haven't added it to the docs, here it is:

  • css
  • https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap.min.css
  • css_theme
  • https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap-theme.min.css
  • js
  • https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/js/bootstrap.min.js

Also made a host for the docs.
The cdns are mentioned on the home page of bootstrap.7pro.ca

joseph.olstad’s picture

wow very strange comment #23 vanished.

klemendev’s picture

Big thanks @joseph.olstad for the efforts done here! Amazing work, looking forward to the movement of this, as it would be an amazing thing not having to go to Bootstrap 5 as some of my websites would require tons of work to achieve that

jcnventura’s picture

@joseph.olstad Think about never actually doing any release other than alpha1, alpha2, etc. There are known security vulnerabilities that have gone unpatched for the last 5 years.. If you're going to make new versions, you need to decide if you take the responsibility to fix those vulnerabilities or if you simply ignore them. Marking them as alpha clearly signals those releases as unsupported.

joseph.olstad’s picture

If you know of any security vulnerabilities, please let me know where to find them! If they affect current supported jQuery3/4 with bootstrap 3, then they'll be dealt with, if it's for older versions only, then no.
Keep in mind, I already gutted IE support which actually went well, was pretty straight forward.

klemendev’s picture

I think the IE support removal is very good change too

joseph.olstad’s picture

working through some issues, I'll try to slow down the noise here.

joseph.olstad’s picture

StatusFileSize
new14.69 KB
new30.42 KB

Ok, so here's the steps to get Bootstrap working with D11:

Install the latest Drupal 11

  • mkdir web/themes/contrib
  • cd web/themes/contrib
  • git clone git@git.drupal.org:project/bootstrap.git
  • git fetch "git@git.drupal.org:issue/bootstrap-3428283.git" 'project-update-bot-only'
  • git checkout -b 'bootstrap-3428283-project-update-bot-only' FETCH_HEAD
  • install the bootstrap theme from the web ui
  • Go to bootstrap settings /admin/appearance/settings/bootstrap
  • look for the CDN settings
  • Change the provider to "Custom"
  • review the Custom URLs, place these ones in if they're not correct.
    https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap.css
    https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap-theme.css
    https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/js/bootstrap.js
    

    Bootstrap settings in D11.0.3

  1. hit the apply button
  2. press save configuration

D11.0.3 with Bootstrap

vladimiraus made their first commit to this issue’s fork.

vladimiraus’s picture

Status: Active » Needs work

Need to

  • Close MR 40 as it is against 7.x branch
  • Review failing phpstan messeges

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

joseph.olstad’s picture

The phpstan errors are due to d.o pipeline stricter and stricter test settings for Drupal 11 that are causing this.

They're asking for dependency injection in various spots. Previously this was not forced in the testing pipeline when testing against Drupal <=10.2.

vladimiraus’s picture

@joseph.olstad injection is now standard.
Next minor will test for 10.4.x which is handy.

jcnventura’s picture

Title: Automated Drupal 11 compatibility fixes for bootstrap » Automated Drupal 11 compatibility fixes for bootstrap 8.x-3.x

Making clear what this is all about, now that the theme already supports Drupal 11 in the 5.0.x branch

joseph.olstad’s picture

@vladimiraus I appreciate your assistance on this. Have you tried it yourself yet with D11.0.3 ?

hatuhay’s picture

joseph.olstad’s picture

@hatuhay, thanks for that. With that said, my projects are 100% locked to bootstrap 3, bootstrap 5 is not an option.

hatuhay’s picture

@joseph.olstad
We are just openning new choices, not closing any.

joseph.olstad’s picture

Yes, I appreciate your bootstrap 5 efforts and have no qualms there however I'm actually a bit choked that I don't have access to edit the project page ***EDIT*** Shelane just granted me access *** END EDIT *** to put in a blurb about the ongoing work for Drupal 11 compatibility with Bootstrap 3x /jQuery 4, I am a co-maintainer prior to you joining but I have the lowest access rights.

I've gotten quite far along here but it would be great to get additional assistance as the only way I've got this to work is with the custom cdn option. I'd really appreciate assistance getting the other cdn providers to handle the new bootstrap version that is jQuery 4 compatible.

jcnventura’s picture

@joseph.olstad, I think for CDNJS you will have to get support from the Bootstrap team to publish under their organization. Considering that HeroDevs has somehow gotten some support to be their Bootstrap 3 long-term support partner, you might need to somehow have that partnership cancelled. See https://github.com/cdnjs/cdnjs/discussions/14191

As to jsDeliver, you can try the following: https://medium.com/javarevisited/how-to-host-your-repository-js-css-on-o... (not sure if it is still applicable).

Edit: Yes, it is still applicable, the current https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap/dist/js/bootstrap.m...
It should be possible to use https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@3.4.2/dist/js/bootstrap.min.js, but I think you'd need to tag 3.4.2 for that to work.

joseph.olstad’s picture

jsdelivr supports all github projects , what we can do is update the jdelivr provider to handle the new pattern.

https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap.min.css
https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap-theme.min.css
https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/js/bootstrap.min.js

or non minified

https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap.css
https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/css/bootstrap-theme.css
https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@v3.4.2/dist/js/bootstrap.js

These are legit cdns anyone can use now ^

What the issue is is the bootstrap jsdelivr provider logic is pattern matched to twbs

It's a bit tricky work to update the jsdelivr provider for the drupal theme called bootstrap 8.x-3.x but not unsurmountable. If anyone else wants to move this forward that'd be great.

Currently the pre-release version I've been developing is called v3-dev-7 but is targetted to be called v3.4.2 (the next minor, but we could call it 3.5.0 as it is a pretty big jump (IE compatibility removed, jQuery 4 support added, it wasn't too hard actually so far))

I've already asked twbs if they were interested however they are not. If they change their minds, someone later could undo the branding changes I've made and present that to twbs however I've already explored that and there was no interest from them.

So, we now own it.

jcnventura’s picture

Before you tag the next version you should also address and fix the following:

  1. https://nvd.nist.gov/vuln/detail/CVE-2024-6484
  2. https://nvd.nist.gov/vuln/detail/CVE-2024-6485
klemendev’s picture

I don't understand the ins and outs of Bootstrap, so excuse me if this is a dumb question, but what will happen with jQuery UI dependencies this module depends on? I have checked and it seems jQuery UI only works with jQuery versions up to 3.7

joseph.olstad’s picture

@klemendev , Drupal 11 core ships with jquery.ui that is compatible with jQuery 4

There is no issue. jQuery is upgraded to jQuery 4 in Drupal 11 however jQuery UI appears to be compatible. jQuery != jQuery UI

@jncventura,
here is the upstream issue for those two CVEs
https://github.com/entreprise7pro/bootstrap/issues/1

klemendev’s picture

I see, thanks for the info @joseph.olstad

joseph.olstad’s picture

It should be possible to use https://cdn.jsdelivr.net/gh/entreprise7pro/bootstrap@3.4.2/dist/js/bootstrap.min.js, but I think you'd need to tag 3.4.2 for that to work.

Yes, I haven't tagged 3.4.2 yet but that is the idea. I am hoping to get assistance with this issue first:

https://github.com/entreprise7pro/bootstrap/issues/1

klemendev’s picture

I have attempted to fix one of the CVEs, reviews are welcome at https://github.com/entreprise7pro/bootstrap/pull/2

joseph.olstad’s picture

Merged that and tagged a new build with the fix for CVE-2024-6485 , it looks good.
Updating the references above to the latest cdn v3-dev-7

Thanks very much to @klemendev!

joseph.olstad’s picture

Issue summary: View changes

Updating references from v3-dev-6 to v3-dev-7

klemendev’s picture

Now that the critical CVE was fixed (the other one I don't believe is valid), is this ready for a release? It would be nice to see D11 ready release of Bootstrap 3 :)

If any other help is needed, I can try to help further

joseph.olstad’s picture

Thanks for the CVE fix!

Awesome

And yes, more help is needed for the bootstrap theme cdn providers, right now it's using the "Custom" provider
we can discuss over the weekend or next week. I've updated all references in this issue to reference the new updated CDN that has the CVE fix.

xem8vfdh’s picture

thanks everyone for your work on this, very exciting :)

joseph.olstad’s picture

what we could do is detect the drupal version , for Drupal 11, automatically set the provider to "custom" and automatically set the cdn values to the latest current as listed at https://bootstrap.7pro.ca
This way, once we commit this Drupal 11 compatibility, we don't cause any surprises for those who will continue using Drupal 10 for quite some time yet.

klemendev’s picture

This could work. But still keep the local files option available, because there are use cases/users (most of our websites, for example), where local files are used.

joseph.olstad’s picture

Issue summary: View changes

Ok, I've published the v3.4.2 tagged release, thanks so much for your support @klemendev

Some work will be required to adjust this new v3.4.2 bootstrap to function correctly with the cdn other provider type. Now that we have the version tag v3.4.2 we are able to move this forward with less of a refactor to the provider code.

For those wanting to use Drupal 11 with bootstrap 3 today, please use the custom provider as described above in the issue summary. Updating issue summary now to put the v3.4.2 into the cdn reference.

klemendev’s picture

Are there any outstanding changes needed on the module itself to run on Drupal 11?

joseph.olstad’s picture

As discussed above, this Drupal theme is ready to use with Drupal 11 using this merge request and following the instructions. With that said, the only cdn provider option that is currently functional is the 'custom' cdn provider and the custom provider has been marked deprecated for some reason for quite some time. What would be great is for at least one of the other providers not marked as deprecated to be also optionally functional. A flag for legacy library should be added and defaulted to TRUE so that we do this harmoniously. For Drupal 11+, this proposed flag should be disabled (automatically set to false) and the library pattern should be affected by this flag being set to false which will bring in the new library pattern for entreprise7pro/bootstrap and the v3.4.2+ with 3.4.2 as a minimum version.

I'm hoping this isn't too hard to do, last I checked it hinged on the release tag numbering pattern to match legacy. Now that we have 3.4.2 available can start on the other provider option. I'd appreciate assistance with this if you or someone else has time!

If for some reason, the "custom" cdn provider becomes our only feasible option going forward then I would suggest to remove the deprecation notes on the "custom" cdn provider as this is currently our only option for Drupal 11.

With that said, the new library that is compatible with jQuery 4 should also be backwards compatible with jQuery 3 and older versions of jQuery (however I have not tested these).

I'm optimistic that another cdn provider from the options available can be adjusted to work with the new entreprise7pro/bootstrap library v3.4.2+ with that said, I haven't had time to have another go at this so I do appreciate extra help.

If there's changes to make that move us forward then please go ahead and push them into the merge request. Hopefully tested changes.

  • joseph.olstad committed 7bf0acfc on bootstrap-3428283-project-update-bot-only
    Issue #3428283 by joseph.olstad, jcnventura, vladimiraus, klemendev:...
project update bot’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new1.33 KB
new2.73 KB
new21.01 KB

This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

It is important that any automated tests available are run and that you manually test the changes.

Drupal 11 Compatibility

According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 11.

Currently Drupal Rector, version 0.20.3, cannot fix all Drupal 11 compatibility problems.

Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

Debug information

Bot run #11-318179

These packages were used to generate the fixes:

  1. drupal/upgrade_status: 4.3.6
  2. mglaman/phpstan-drupal: 1.3.1
  3. palantirnet/drupal-rector: 0.20.3
jerech’s picture

Issue summary: View changes

There are a few changes in MR 37 that still need to land. Besides that, what more needs to be done before official D11 support for v3 is available and new 3.x release tagged?

joseph.olstad’s picture

@jeremy1606, please see comment #69.

What has been done so far:

  • We forked "twbs/bootstrap" into "entreprise7pro/bootstrap"
  • We removed IE support from entrepreprise7pro.ca/bootstrap
  • We upgraded this new bootstrap to be compatible with jQuery 4
  • We fixed CVE-2024-6485
  • We successfully tested Drupal 11 which brings jQuery 4 and this new bootstrap with custom cdn provider as described above
  • cdns are available now
  • Stood up documentation site https://bootstrap.7pro.ca

What is left todo:

  • Complete the fork of bootstrap-sass. Some folks using bootstrap 3 may also need bootstrap-sass (this shouldn't take very long to complete but isn't yet completed) - Assigned this task to myself joseph.olstad
  • Update the other cdn providers so that when using Drupal 11 will offer one of the stable jQuery4 compatible entreprise7pro/bootstrap releases. (Currently only custom cdn is working, it would be nice if the others worked with the new bootstrap library when running Drupal 11. I'm suggesting core version detection in the project code where we check for minimum D11 and handle this gracefully in the solution. This task is ready to be worked on now.
  • Complete these items, test everything thoroughly and then when satisfied merge the above merge request and tag a new D11 compatible 3x release.
heddn’s picture

There's something odd going on here. MR 37 has virtually no changes in it any longer. The changes in bootstrap-3428283-project-update-bot-only branch still exist. But the MR on this issue has nothing in it. Do we need to rebase something?

somersoft made their first commit to this issue’s fork.

somersoft’s picture

Alternative installation of the code if this repository was used directly, by adding the following to the project's composer.json

    "repositories": [
        {
            "type": "vcs",
            "url": "https://git.drupalcode.org/issue/bootstrap-3428283.git"
        }
    ],

and

    "require": {
        "drupal/bootstrap": "dev-project-update-bot-only",
    }

then composer can create a compatible set of packages.

joseph.olstad changed the visibility of the branch project-update-bot-only to hidden.

joseph.olstad changed the visibility of the branch project-update-bot-only to active.

joseph.olstad’s picture

@heddn, when things get dicey, I suggest re-cloning the project and following these steps.

git remote add bootstrap-3428283 git@git.drupal.org:issue/bootstrap-3428283.git
git fetch bootstrap-3428283

git checkout -b 'project-update-bot-only' --track bootstrap-3428283/'project-update-bot-only'

MR 37 looks as expected
https://git.drupalcode.org/project/bootstrap/-/merge_requests/37

heddn’s picture

MR37 did not indicate Drupal 11 support in the .info.yml file nor composer.json file. I see that overnight it was added in https://git.drupalcode.org/project/bootstrap/-/merge_requests/37/diffs?c.... That was the bit that was missing and caused me to question everything about that MR.

joseph.olstad’s picture

**EDIT**
checking

joseph.olstad’s picture

MR37 is clearly identified as compatible with Drupal 11
There are a couple todo items
Please refer to comment #73 #3428283-73: Automated Drupal 11 compatibility fixes for bootstrap 8.x-3.x
My current priority is the bootstrap-sass fork , as soon as it's completed I'll update this issue.

If you are impatient and want to try bootstrap with Drupal 11 immediately then please have a look at the setup steps outlined in the issue summary.

joseph.olstad’s picture

Issue summary: View changes

Updated the issue summary.

heddn’s picture

After upgrading to D11 with this patch installed, we cannot visit /admin/appearance/settings/bootstrap It gives guzzle errors. The IS has instructions for installing a fresh install with D11 but doesn't yet provide any guidance on upgrade. I haven't had time to investigate where the errors are coming from.

joseph.olstad’s picture

I'll review #84 and see what's happening, currently I'm working on the bootstrap-sass fork, once that's done I'll get back to the integration part.

What version of D11 are you upgrading to?

@heddn, can you please provide more detailed description of the related "guzzle" errors?

joseph.olstad’s picture

I'm finalizing npm packaging for the upgraded bootstrap / bootstrap-sass.

So far I have pushed up a gem:

https://rubygems.org/gems/bootstrap

I need to wait 24 hours to republish for npm, I unpublished a first attempt without knowing that it would cause a 24+ hour delay before republishing as they do not allow quick republishing.

https://www.npmjs.com/package/entreprise7pro-bootstrap-sass
https://www.npmjs.com/package/entreprise7pro-bootstrap

With that said, bower is good to go for both:

bower install entreprise7pro/bootstrap --save
bower install entreprise7pro/bootstrap-sass --save

Along the way I discovered that jquery 4.0.0 is still in it's second beta, so Drupal 11 ships with a beta version of jQuery 4. This is news to me.

For the gem, because there's no ruby package for jquery 4 I cooked in the 4.0.0-beta2 version into the gem.

Updated the documentation today also https://bootstrap.7pro.ca

Not much is different except the new release version, now v3.4.3 and there's an actual updated bootstrap-sass build.

The github repos, for those interested:
https://github.com/entreprise7pro/bootstrap-sass
https://github.com/entreprise7pro/bootstrap

joseph.olstad’s picture

StatusFileSize
new39.18 KB

I upgraded my test environment which has basically Drupal 11.0.6 core by it'self along with the D11 versions of jquery_ui, jquery_ui_draggable jquery_ui_resizable projects.

The upgrade from Drupal 11.0.3 to 11.0.6 worked fine.

Now with the v3.4.3 cdn, I'm seeing a version number available.

See screenshot:

D11.0.6 with Bootstrap from Entreprise7pro version 3.4.3 and jQuery 4

joseph.olstad’s picture

@heddn, it's possible that you need to do the following in your tests:

composer require drupal/jquery_ui drupal/jquery_ui_draggable drupal/jquery_ui_resizable

Please try this again then visit the appearance configuration where the cdn settings need to be adjusted.

/admin/appearance/settings/bootstrap

kalash-j’s picture

Hey @joseph.olstad I am also facing issue on accessing /admin/appearance/settings/bootstrap
i have also used this composer require drupal/jquery_ui drupal/jquery_ui_draggable drupal/jquery_ui_resizable
still i am facing the issue , my drupal core version is 11.0.7
and jquery version is 4.0.0-beta.2
settings

joseph.olstad’s picture

@kalash-j and @heddn, your exception is thrown after the alter is called for: bootstrap_form_system_theme_settings_alter

Is it possible that you have hook_form_system_theme_settings_alter code in one of your other themes/modules that is interfering? Perhaps your sub theme?

I have tested with my subtheme and have not gotten this exception .

Make sure you're using the merge request version of this, I will merge this into dev.

joseph.olstad’s picture

I merged the D11 upgrade into the 8.x-3.x , not going to tag a release, still looking into the bootswatch, I may have missed something related to the theme options.

  • joseph.olstad committed 5ef2beed on 8.x-3.x
    Issue #3428283 by joseph.olstad - Bootswatch theme support.
    

  • joseph.olstad committed 4c84251d on 8.x-3.x
    Issue #3428283 by joseph.olstad - Bootswatch theme support - add comment...
manishvijay02’s picture

StatusFileSize
new140.58 KB
new258.73 KB

@joseph.ostald I don't have the hook_form_system_theme_settings_alter function in my subtheme; it only exists in the bootstrap.theme file. However, when I comment out this line, the settings do not display correctly in the Bootstrap theme.
In Drupal 10, the settings were fully visible without needing to comment out the hook_form_system_theme_settings_alter line, and I didn't encounter any errors.
However, after upgrading to Drupal 11, I started receiving an error, as mentioned in #89. To resolve this, I removed the hook_form_system_theme_settings_alter line from the bootstrap.theme file, which eliminated the error. But, now the settings are not displaying properly.

Attaching the screenshots for the same.
Thanks.

joseph.olstad’s picture

Assigned: Unassigned » joseph.olstad
Status: Needs review » Active

Hi @manishvijay02 , if you uninstall your subtheme does this error still occur?

If so, I'd like to see your subtheme.

With that said, this might be related to some settings that you have configured. I haven't been able to reproduce the reported issue yet.

Put back the hook code and have a closer look at this:

src/Plugin/Form/SystemThemeSettings.php

With that said, I've got something else to look at to improve the theme upgrade path.

heddn’s picture

Status: Active » Reviewed & tested by the community

Our errors went away with one of those last commits. Looks great. We're now on D11 with the dev branch of this theme.

klemendev’s picture

That is some very exciting news!

joseph.olstad’s picture

Status: Reviewed & tested by the community » Active

I've still got a small bit of work to do to make the upgrade path smoothest possible for everyone.

  • joseph.olstad committed 9ea55cea on 8.x-3.x
    Issue #3428283 by joseph.olstad - Merge the amended commit message.
    

  • joseph.olstad committed 39aaafd2 on 8.x-3.x
    Issue #3428283 by joseph.olstad - For Drupal 11 and Drupal 10...
joseph.olstad’s picture

Status: Active » Fixed

Resolved.

Tested and tagging an rc1 release shortly.

joseph.olstad’s picture

xem8vfdh’s picture

thanks everyone!

joseph.olstad’s picture

I'll have to add to the release notes.

The only cdn provider options that have been tested to work for this upgrade are jsdelivr and the custom provider option. I don't have any statistics on which providers are mostly used but I would assume that most are using either the jsdelivr option or the custom provider option.

The bootswatch theme options are still supported.

Please open new issues for any additional support requests/feature requests or bugs/tasks.

  • joseph.olstad committed c99e4d30 on 8.x-3.x
    Issue #3428283 by joseph.olstad - For Drupal 11 and Drupal 10...
joseph.olstad’s picture

FYI: A new Drupal 11 compatible release has been tagged today 8.x-3.33-rc2

mably’s picture

Great work, thanks @joseph.olstad!

f1mishutka’s picture

Tremendous work! Thank to everybody!

P.S.: I'm proud to be a part of such awesome community. Drupal people make world a better place. Literally!

klemendev’s picture

Thank you everybody for your outstanding work on this! :)

joseph.olstad’s picture

Assigned: joseph.olstad » Unassigned

Published 8.x-3.33

klemendev’s picture

Thanks to everyone involved in making this happen, especially to joseph.olstad for pushing the work :)

danchadwick’s picture

This issue requires D10.2, but its 10.3 that has the stick table header change that this issue requires. Not sure if the issue status should be changed to needs work or what.

joseph.olstad’s picture

Hi @danchadwick , thanks for reporting this issue.

According to this report, it means that anyone using 10.2 will want to stick to 3.32 instead of upgrading.

  • joseph.olstad committed 528d6d4b on 8.x-3.x
    Issue #3428283 by danchadwick: Automated Drupal 11 compatibility fixes...
joseph.olstad’s picture

joseph.olstad’s picture

New release and instructions for those still using D10.2.

https://www.drupal.org/project/bootstrap/releases/8.x-3.34

Status: Fixed » Closed (fixed)

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