The bootstrap tags are not saved

Created on 7 May 2023, over 1 year ago
Updated 13 July 2023, over 1 year ago

Problem/Motivation

I run in a problem by setup a new Drupal 10 website when using the Layout Builder with the bootstrap layout builder. When on the change layout- page (use layout-builder=>manage layout) I can save the page-layout, bud the output bootstrap tags are not Ok. Even on the layout- page the chosen layout is not displayed as I am used to. ( /admin/structure/types/manage/page/display/default/layout )

Steps to reproduce

Configure a section, then chose "Two equal columns" for desktop. Save the changes and save the page. On the output-page the section container is still "<div class="col-lg-12 col-md-12 col-12">", expected <div class="col-lg-6 col-md-6 col-6"> or something.
It looks there is something wrong on the layout-page when selecting one of the "Two equal columns / 25% 75% / 75% 25% "

When I go to the reports page ( /admin/reports ) I find a error " Message Deprecated function: substr(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\bootstrap_layout_builder\Entity\Breakpoint->getClassByPosition() (line 124 of /home/[home-map]/public_html/modules/contrib/bootstrap_layout_builder/src/Entity/Breakpoint.php) "

Proposed resolution

I tried the patches for some issues, I was thinking it could solve the problem. Bud unfortunately they didn't.
Then installed different themes, bud also no luck.
I can't find a existing issue with the same question.
so now making a new one.

Remaining tasks

I looked at the code of Breakpoint.php #124 bud unfortunately my knowledge of programming is not sufficient to solve this.

I use PHP 8.1 and a new setup with composer.json:
{
"name": "drupal/recommended-project",
"description": "Project template for Drupal projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": " https://www.drupal.org/project/drupal ",
"support": {
"docs": " https://www.drupal.org/docs/user_guide/en/index.html ",
"chat": " https://www.drupal.org/node/314178 "
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"composer/installers": "^2.0",
"drupal/bootstrap_barrio": "^5.5",
"drupal/bootstrap_layout_builder": "^2.1",
"drupal/bootstrap_styles": "^1.1",
"drupal/core-composer-scaffold": "^10.0",
"drupal/core-project-message": "^10.0",
"drupal/core-recommended": "^10.0",
"drupal/layout_builder_blocks": "^1.1"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
},
"sort-packages": true
},
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "public_html/"
}
},
"installer-paths": {
"public_html/core": [
"type:drupal-core"
],
"public_html/libraries/{$name}": [
"type:drupal-library"
],
"public_html/modules/contrib/{$name}": [
"type:drupal-module"
],
"public_html/profiles/contrib/{$name}": [
"type:drupal-profile"
],
"public_html/themes/contrib/{$name}": [
"type:drupal-theme"
],
"drush/Commands/contrib/{$name}": [
"type:drupal-drush"
],
"public_html/modules/custom/{$name}": [
"type:drupal-custom-module"
],
"public_html/profiles/custom/{$name}": [
"type:drupal-custom-profile"
],
"public_html/themes/custom/{$name}": [
"type:drupal-custom-theme"
]
},
"drupal-core-project-message": {
"include-keys": [
"homepage",
"support"
],
"post-create-project-cmd-message": [
" ",
" Congratulations, you’ve installed the Drupal codebase ",
" from the drupal/recommended-project template! ",
" ",
"",
"Next steps:",
" * Install the site: https://www.drupal.org/docs/installing-drupal ",
" * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html ",
" * Get support: https://www.drupal.org/support ",
" * Get involved with the Drupal community:",
" https://www.drupal.org/getting-involved ",
" * Remove the plugin that prints this message:",
" composer remove drupal/core-project-message"
]
}
}
}

💬 Support request
Status

Closed: duplicate

Version

2.1

Component

Code

Created by

🇳🇱Netherlands MLZR Zutphen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @MLZR
  • 🇳🇱Netherlands MLZR Zutphen
  • 🇳🇱Netherlands MLZR Zutphen

    I was investigating to solve this problem. I strumbled over two patches of the module "Media Library Form API Element":

    1. https://www.drupal.org/files/issues/2023-01-25/deprecated-explode-327727...
    2. https://www.drupal.org/files/issues/2023-05-10/check-default-value-not-a...

    After installing these the bootstrap tags changed: now I get a " class="col-lg-6 col-md-12 col-12". So the first tag is changed now.

    This is a small improvement.. bud only the first tag is now changed, the others are still wrong; (col-md-12 col-12) i clicked for "Tablet" or "Mobile" also on "Two equal columns". Bud that is still not working..
    And Unfortunately, the first tag is still not working correctly; when I change it to ' 25% 75% ' then when I save the changes the columns change back to Two equal columns.

    When I click on "desktop", "Tablet" or "Mobile", after a click on either of these, the error " Deprecated function: substr() " still appear in the log messages.

    Deprecated function: substr(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\bootstrap_layout_builder\Entity\Breakpoint->getClassByPosition() (line 124 of /home/realisterwb/public_html/modules/contrib/bootstrap_layout_builder/src/Entity/Breakpoint.php)

  • 🇳🇱Netherlands MLZR Zutphen

    Little update.. I've tried a new install with the composer.json as above since it is a couple of weeks ago I run into this issue. I see lots of improvements, bud unfortunately for this case nothing is changed.

    Anybody?

  • 🇺🇸United States jaygriggs

    When I go to the reports page ( /admin/reports ) I find a error " Message Deprecated function: substr(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\bootstrap_layout_builder\Entity\Breakpoint->getClassByPosition() (line 124 of /home/[home-map]/public_html/modules/contrib/bootstrap_layout_builder/src/Entity/Breakpoint.php) "

    This is a warning not an error. This is a warning in php 8.1 and will be an error in PHP 9.
    Has anyone else tested this module in D10?

  • 🇺🇬Uganda Thomas Kaisuka

    I got the same problem too. All the errors i got were similar to what you have shown MLZR. Still fiddling around for a solution.

  • 🇳🇱Netherlands MLZR Zutphen

    Ok, there is a solution! issue #3335356 🐛 Fix Drupal 10 compatibility issues with Bootstrap Layout Builder Fixed seems a duplicate. I patched my setup with issue_3335356_drupal10.patch and now things are working!

  • 🇳🇱Netherlands MLZR Zutphen
  • Status changed to Closed: duplicate over 1 year ago
  • 🇳🇱Netherlands MLZR Zutphen
Production build 0.71.5 2024