Problem/Motivation

When choosing a layout for a section, the following error appears:
Twig\Error\LoaderError: Template "/asmbly/web/modules/contrib/bootstrap_styles/images/ui/layout.svg" is not defined in "__string_template__1d495723f3fb6444e2a82660924999132ec13ce5ff97e15d708cd688b66b4683" at line 1. in Twig\Loader\ChainLoader->getCacheKey() (line 142 of D:\xampp\htdocs\asmbly\vendor\twig\twig\src\Loader\ChainLoader.php).

Steps to reproduce

Using Drupal 8.9.11, Bootstrap 3.
Upgraded the module to 2.0.0 with composer. Enabled Bootstrap Styles.
When trying to choose a layout for a section in Layout Builder (clicking on e.g. Bootstrap 2 Cols), the layout details do not show and the above error appears in watchdog.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

JordiK created an issue. See original summary.

jordik’s picture

Issue summary: View changes
jordik’s picture

StatusFileSize
new782 bytes

Removing the base_path() while generating the tabs with icons solved the issue for me.

jordik’s picture

Status: Active » Needs review
g0105’s picture

StatusFileSize
new197.73 KB

Hello, the patch didn't help. I am using Drupal 9.1.0, Drupal Commerce 2.21, Bootstrap Layout Builder 2.0.0

When editing the layout in Commerce / admin / commerce / config / product-types / default / edit / display / default / layout
I see huge icons and non-working sections

rajab natshah’s picture

Title: Error when choosing a layout » Fix Error when choosing a layout

Having the same issue with Drupal 9.
And when the site is located in a sub-directory.
And when the site is a multilingual website with a URL language selection.
much like
#3183443: Fix Unable to add a block in layout and it gives ajax error

Suggesting to remove base_path or change it to the original path
\Drupal::request()->getSchemeAndHttpHost() . \Drupal::request()->getBaseUrl()

Removing the base_path is the better option in my opinion.

rajab natshah’s picture

Title: Fix Error when choosing a layout » Fix Error when choosing or editing a layout for a section
rajab natshah’s picture

StatusFileSize
new782 bytes
jordik’s picture

@RajabNatshah - please explain the difference between the patch you provided in #8 and the patch provided in #3.

rajab natshah’s picture

Oh sorry Jordan
They are the same!
I think I mixed that up with
#3183443: Fix Unable to add a block in layout and it gives ajax error
They had '/' . in the patch
also
#3191446: Fix base path issues with multilingual websites and if Drupal was located in a sub-directory

I'm testing this nice module along with the Bootstrap Styles, Layout Builder Blocks .. modules
#3190716: Start a 10.0.x branch for Varbase Layout Builder to use Bootstrap Styles and Bootstrap Layout Builder

I removed my patch file to have yours back in the default list

rajab natshah’s picture

jordik’s picture

Thank you for the clarification Rajab! Can you confirm the patch in #3 works for you?

rajab natshah’s picture

Status: Needs review » Reviewed & tested by the community

Patch #3 is working well.
Thank you.

Send to RTBC

  • mahmoud-zayed committed 128ddca on 2.x
    Issue #3188729 by JordiK, RajabNatshah, g0105: Fix Error when choosing...
mahmoud-zayed’s picture

Status: Reviewed & tested by the community » Fixed
mahmoud-zayed’s picture

Status: Fixed » Closed (fixed)