Needs review
Project:
Bootstrap Styles
Version:
1.2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2023 at 15:02 UTC
Updated:
23 Apr 2026 at 10:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
olegrymar commentedA patch has been added to fix this issue.
Comment #3
olegrymar commentedComment #4
olegrymar commentedComment #5
jandewit6 commentedAlso here I am running into this issue. making it impossible to update layouts as all added sections are 'saved'.
After applying the patch, still the same issue. Adaptations are saved according to front end, but on re-opening the layout, the newly added sections disappeared.
After applying the patch, I am getting a OutOfBoundsException: Invalid delta "0" in Drupal\layout_builder\Field\LayoutSectionItemList->getSection() (line 42 of ***/public_html/core/modules/layout_builder/src/SectionListTrait.php).
Comment #6
iamweird commentedProbably this issue is obsolete since #3388219: Fix InvalidArgumentException: Invalid ID provided for the media entity already changed same lines as patch from #2. Can anyone provide steps to reproduce this issue?
Comment #7
chikeI can still reproduce this issue on Bootstrap Styles 1.2.2. The error occurs when trying to save a block in Layout Builder when the background video media bundle is not configured in the Bootstrap Styles settings.
The patch from #2 no longer applies to the current codebase. I've created an updated patch that addresses the root cause:
The issue is in the
submitStyleFormElements()method at line 364. The method attempts to access$group_elements['background_video']without checking if it exists. The `background_video` field is only added to the form conditionally (line 261) - only when a video media bundle is configured. When this configuration is missing, the field doesn't exist in the form, causing the undefined array key warning.This patch adds:
isset()check before accessing `background_video`The patch works for me on Drupal 11.3.1 with Bootstrap Styles 1.2.2.
Comment #8
chikeComment #9
bbu23On website installed with
minimalrecipe, the expected media types won't be available. The module should not assume the presence of an optional media entity type.In the latest version of the module at the time of writing (1.2.3), on a website using
minimalplus only the media image bundle installed, the configuration form is broken and the layout builder is almost impossible to use. This is because the module expects the local video media bundle to exist.After installing the local_video_media_type recipe from core, and navigating to the global configuration form, the media field is correctly populated, so resaving the settings also fixes the crashes in the layout builder.
Proposed resolution: Make the configuration dynamic and not dependant on some core types that can be missing when not using the standard recipe. Not everybody wants to have a local video media type installed, or maybe others prefer to set up their own media types with custom IDs. The module should take in consideration the minimal installation first.