-
Improvement
-
Resolution: Fixed
-
Minor
-
5.0
-
MOODLE_500_STABLE
-
MOODLE_500_STABLE
-
MDL-84450-main -
-
-
-
2
-
HQ 2025 Sprint I1.1 Moppies
Per Bootstrap migration documentation:
"[Breaking] Data attributes for all JavaScript plugins are now namespaced to help distinguish Bootstrap functionality from third parties and your own code. For example, we use data-bs-toggle instead of data-toggle."
Those data attributes have been migrated in core as part of MDL-75669 (in this specific commit: https://github.com/roland04/moodle/commit/1f5ff590b15f5063aed5321d6a1a91f696bc25da).
Creating a JS helper module that silently does the replacement will help third-party to have some time for the migration.
The usage should be something like:
import initBootstrap4Compatibility from 'theme_boost/bs4-compat'; |
[...]
|
// Init Bootstrap 4 compatibility giving an specific element to look into.
|
initBootstrap4Compatibility(document.querySelector('[data-region="bs4-compat"]')); |
|
// Init Bootstrap 4 compatibility in the entire document.
|
initBootstrap4Compatibility();
|
or
require(['theme_boost/bs4-compat'], function(BS4Compat) { |
BS4Compat();
|
});
|
- has a non-specific relationship to
-
MDL-85127 Fix the initialization of the BS4 data-attributes compatibility helper
-
- Closed
-
- has to be done after
-
MDL-75669 Upgrade the Boost theme with Bootstrap 5.x
-
- Closed
-
- has to be done before
-
MDL-84465 Final deprecation of Bootstrap 4 compatibility
-
- Open
-
- links to