Problem/Motivation
When logged out there is a javascript error in /js/plugins/background_media/build.js that prevents the script adding the inline height CSS property to .background-local-video. No height means the absolute positioning of the video fails and consequently the video isn't visible.
(Looks like this is also an issue with scroll_effects too.)
Steps to reproduce
Add a background video to your section. Log out and view the page. The video won't display because there is no height set on the .background-local-video div. Inspect console and you'll see an "Uncaught TypeError: can't access property "behaviors", Drupal is undefined" error.
Tested in latest Chrome build and Firefox Developer Edition.
Proposed resolution
Extending my theme to include the following works, but should this be done at the module level?
libraries-extend:
bootstrap_styles/plugin.background_media.build:
- core/jquery
- core/drupal
Comments
Comment #2
QuietSpecialist commentedComment #3
QuietSpecialist commentedComment #4
QuietSpecialist commentedComment #5
scottriggle commentedSame issue with me.
Comment #6
cassioalmeida commentedHi everyone, thanks for the contribution.
The only way that I was able to reproduce the issue was by creating a section without any block/content, only with the background video.
If you add any block/content you should see the background fixed/centered. Also, the height must be based on content height and some padding, not the background.
I hope that makes sense. I'll mark it as work as designed, please let me know if you have any other cases.
Regards,
Cassio
Comment #7
andre.bonon commentedHi, @QuietSpecialist, I was not able to reproduce the "Uncaught TypeError: can't access property "behaviors", Drupal is undefined" error in a fresh Drupal 9 installation + Bootstrap Barrio subtheme.
Modules installed:
- drupal/layout_builder_blocks
- drupal/bootstrap_styles
- drupal/bootstrap_layout_builder
I've added a new section and a custom block inside it. I selected a background video and saved. Also I hide the h2 element of the custom block.
Results:
- no errors found on last chrome build.
- background video not visible due to the height missing. Which is expected since I've not added any content to it.
As @cassioalmeida mentioned, this is working as design.
If this issue still happening, please feel free to reopen this issue and add more information of how to reproduce it.
For instance, the drupal core version, theme installed, layout builder configuration and so on.
Comment #8
QuietSpecialist commentedThanks for looking into.
Comment #9
scottriggle commented@QuietSpecialist, did you ever resolve this? It's still happening for me and I place what you suggested into my info file.