Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On line 315 of bootstrap_carousel.module
,
if (isset($slide['carousel_video'])) {
drupal_add_js(variable_get('bootstrap_carousel_youtube_player_api', 'https://www.youtube.com/player_api'), 'external');
}
We should use empty
function instead of isset
like below.
if (!empty($slide['carousel_video'])) {
drupal_add_js(variable_get('bootstrap_carousel_youtube_player_api', 'https://www.youtube.com/player_api'), 'external');
}
Comment | File | Size | Author |
---|---|---|---|
#1 | stop-loading-js-empty-2304031-1.patch | 540 bytes | gabrielmachadosantos |
Comments
Comment #1
gabrielmachadosantos CreditAttribution: gabrielmachadosantos at CI&T for Pfizer, Inc. commentedIt was also loading the JS for each slide. Tested and patched.
Comment #2
rhormens CreditAttribution: rhormens at CI&T commented+1 RTBC
Comment #3
gabrielmachadosantos CreditAttribution: gabrielmachadosantos at CI&T for Pfizer, Inc. commentedPatched and committed against 7.x-1.x-dev.