Problem/Motivation

When testing this module in D10 it completely broke. Appears to be an issue with using once()

Steps to reproduce

Install this module on D10

Proposed resolution

Replace once() instances

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ✅ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ✅ Code review from Bootstrap Layout Builder team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release bootstrap_layout_builder-2.1.2

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3335356: Fixed Drupal 10 compatibility issues with Bootstrap Layout Builder
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

smustgrave created an issue. See original summary.

smustgrave’s picture

StatusFileSize
new514.03 KB
prauat’s picture

StatusFileSize
new2.47 KB

I forgot about patching bootstrap layout builder you need this patch for D10 compatibility.
You also need to patch bootstrap styles but you've already seen it.

smustgrave’s picture

Thanks! Will test both first thing tomorrow

smustgrave’s picture

Status: Active » Reviewed & tested by the community

Tested patch #3 in addition to the patch for bootstrap styles and the buttons for breakspoints do appear again.

smustgrave’s picture

Could this be added to a release? As this will be a blocker for some upgrading to D10

rajab natshah’s picture

Title: Module does not work in D10 » Fix Module does not work in D10

Facing the same issue.
Thanks, Paul for the #3 patch.

+     * This is a work around for modules that pass array as css class value
+     * this results in array of arrays that must be flatten before displaying
+     * in twig.

Is this for TWIG ~3.0 ?

rajab natshah’s picture

prauat’s picture

To be honest I haven't been digging deeper into cause of this, but yes my current twig is "twig/twig": "^3.4.3".

jcandan’s picture

I also get the once() errors in the browser console.

I am on Drupal 10.0.2, twig/twig version is 3.5.0, and Radix 5.0.7.

Additionally, I also see the Section column distribution selection doesn't work: the percent selectors are not clickable:

A screenshot of the broken screen size column distribution selector links.

After applying patch #3, I get the following:

A screenshot of the broken screen size column distribution selector links.

A screenshot of the broken screen size column distribution selector links.

While the percent distributions for each breakpoint are now clickable and seem to be working, there are still once() errors and the UI seems incorrectly styled.

jcandan’s picture

In addition to patch #3 here, I updated Radix to 5.0.8 and applied patch #8 from https://www.drupal.org/project/bootstrap_styles/issues/3330458.

All the once() errors are now gone, BUT the UI is still incorrectly styled:

A screenshot of the broken screen size column distribution selector links.

chike’s picture

@jcandan I am getting the same results you have at #11 using Barrio B5 theme and having applied patch #3 here and patch #8 on the 'bootstrap_styles' issue.

david-b’s picture

I applied patch #3 and it fixed errors with .once

podarok’s picture

Status: Needs work » Reviewed & tested by the community

#13 RTBC

yospyn’s picture

Confirming #3 worked for me and I'm seeing same UI weirdness that @jcandan mentions. This is super helpful as I work on a lot of D9 sites using this module and we're about to upgrade them all to D10.

shaunole’s picture

The issue that we're seeing with the layout builder UI is due to the a Drupal Core CSS rule for the drupal-off-canvas-wrapper setting the label's display to "inline" (see line 105 of: /core/misc/dialog/off-canvas/css/form.css) as shown here:

:is(#drupal-off-canvas-wrapper input[type="checkbox"]) + label,
:is(#drupal-off-canvas-wrapper input[type="radio"]) + label {
  display: inline;
}

In order for Bootstrap Layout Builder's display of "flex" to persist, the CSS display attribute found in: bootstrap_layout_builder/css/layout-tab-styles.css would need to be more specific or need to be indicated as 'important'. I'm working on a temporary patch/solution for this and will post shortly.

shaunole’s picture

Status: Reviewed & tested by the community » Needs review

I've created "MR !25" for the provided patch in addition to my previous comment that sets display:flex to display:flex!important.

The patchfile for this MR can be found here: https://git.drupalcode.org/issue/bootstrap_layout_builder-3335356/-/commit/2c6bcfdeae304f838157fabfe88e8168c2bfecd5.patch

Changing status back to Needs Review as a new Patch/MR have been submitted.

Hope this helps!

podarok’s picture

Status: Needs review » Reviewed & tested by the community
dalemoore’s picture

Would someone mind putting together the steps needed to get all these patches working on D10.1+ so that the Bootstrap Styles/Bootstrap Layout Builder works in D10 if it's working for you? I haven't been able to get any of it to work.

chike’s picture

StatusFileSize
new62.18 KB

@dalemoore you can use this collection of patches.

I just installed them a few minutes ago in D10.1.1 and all seems to be going well save that I still get JS once errors logged in the console.

JS once() errors

Not sure if this what makes it that sometimes 'configure section' links will fail to load up the sections and one has to recreate the section and move the blocks to be able to edit existing sections. This has happened twice within an hour now.

mlzr’s picture

Confirm patch #3 works.
Setup Drupal 10.1.1 + PHP 8.1
Thanks!!

thomas kaisuka’s picture

StatusFileSize
new42.31 KB
new29.79 KB

@MLZR patch #3 works when used with patch #8 from https://www.drupal.org/project/bootstrap_styles/issues/3330458

Good to go now. Setup Drupal 10.1.1 + PHP 8.1

A little Ajax Error, but i can live with that

rajab natshah’s picture

Title: Fix Module does not work in D10 » Fix Drupal 10 compatibility issues with Bootstrap Layout Builder

rajab natshah’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed
Issue tags: +bootstrap_layout_builder-2.1.2
rajab natshah’s picture

Issue summary: View changes
mav_fly’s picture

Hello

I updated to the last version of "Bootstrap Layout Builder" en "Bootstrap Styles".
When you choose 2, 3… columns the columns are stacked instead of side by side (see picture).

For this project I have
Drupal 10.1.1
Php 8.2.9
Bootstrap_layout_builder: 2.1.2
Bootstrap Styles : 1.1.1
Bootstrap_library: 2.0.2

For another project where it works perfect :
Drupal 9.3.13
Php 7.4.33
Bootstrap_layout_builder: 2.0
Bootstrap Styles : 1.0
Bootstrap_library": 2.0

Someone any idea to solve that problem ?

I have also some errors on my page see picture

Thanks in advance

thomas kaisuka’s picture

Hello Mav_fly ,

Kindly share a screenshot of your recent log messages every time you try to create columns. Your problem appears to be a jquery/once problem that needs updating to core/once.

On Drupal 10 thats a sign of incompatiblity. I get a feeling there's a related module to BLB that is bringing the issue.

mav_fly’s picture

Hello Thomas

After further investigation on this project. The strange thing is that the layoutblocks are only broken when you set the page as homepage.
When you set for example node1 as homepage and you add columns the are stacked. Then when you set for example node 2 as homepage and you look back to node 1 the columns are then side by side.
So conclusion is that the problems is only on the page how is set as homepage.

Screenshots in attachment

david-b’s picture

thomas kaisuka’s picture

Hello Mav_fly

Your problem should be related to the Layout Builder Blocks deprecate module code, see here https://www.drupal.org/project/layout_builder_blocks/issues/3363647

And deprecate code in the adaptive theme you are using https://www.drupal.org/project/issues/adaptivetheme?categories=All

Am using the bootstrap 5 theme, so it has no deprecated code and works with your same setting.

Try fixing that deprecation and revert with findings

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mav_fly’s picture

@Thomas
I applied the patch for the Layout Builder Blocks and that solved the warnings for this.

But the warnings en problems related for the theme aren't yet solved. From the moment I have a solution I will share it with you!