- 🇮🇳India arunkumarkit
"The latest stable release is now available with full support for Drupal 9, 10, and 11."
Automatically closed - issue fixed for 2 weeks with no activity.
Hello!
I've noticed that my Bootstrap dropdowns stoped working at some point. It seemed the problem appeared only on the pages where the materialize_datetime_picker library was loaded.
It all came back to normal when I commented the line that loads https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js: { type: external } in materialize_datetime_picker.libraries.yml since bootstrap.js v3.4.1 is already loaded by my Bootstrap theme.
My final solution was:
/**
* Implements hook_library_info_alter().
*/
function patients_library_info_alter(&$libraries, $extension) {
if ($extension === 'materialize_datetime_picker') {
array_shift($libraries['materialize_datetime_picker']['js']);
}
}
So, maybe the module itself should implement a hook_library_info_alter and add the external bootstrap.min.js only if the theme is not bootstrap or a bootstrap subtheme.
My setup is:
Drupal 9.1.5
Bootstrap 8.x-3.23 Subtheme
Bootstrap Materialize DateTime Picker 8.x-1.4
With this html in a page where materialize_datetime_picker is loaded:
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Dropdown item 1</a></li>
<li><a href="#">Dropdown item 2</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
Fixed
6.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
"The latest stable release is now available with full support for Drupal 9, 10, and 11."
Automatically closed - issue fixed for 2 weeks with no activity.