Version 2.1.5 causes an error: Class "Drupal\Core\Render\Element\RenderElementBase" not found

Created on 17 September 2024, about 2 months ago
Updated 19 September 2024, about 2 months ago

Problem/Motivation

When you update the module to the 2.1.5 version, there is an error like this:

Error: Class "Drupal\Core\Render\Element\RenderElementBase" not found in include() (line 12 of modules/contrib/bootstrap_layout_builder/src/Element/ContainerWrapper.php).

Steps to reproduce

There are no steps: the error is everywhere on the CMS.

Proposed resolution

Create a patch.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇮🇹Italy drp_distruptor Neaples

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

Comments & Activities

  • Issue created by @drp_distruptor
  • 🇮🇳India sourav_paul Kolkata

    Please verify, your drupal version is less than 10.2...

  • 🇮🇹Italy drp_distruptor Neaples

    #2: my Drupal version is this:

    The version 2.1.5 of this module cause me an error on Drupal 10.3.5;
    while the version 2.1.3 cause the same error on Drupal 10.2.7;

    The website encountered an unexpected error. Try again later.
    
    Error: Class "Drupal\Core\Render\Element\RenderElementBase" not found in include() (line 12 of modules/contrib/bootstrap_layout_builder/src/Element/ContainerWrapper.php).
    
    Composer\Autoload\{closure}('/app/web/modules/contrib/bootstrap_layout_builder/src/Element/ContainerWrapper.php') (Line: 427)
    Composer\Autoload\ClassLoader->loadClass('Drupal\bootstrap_layout_builder\Element\ContainerWrapper')
    class_exists('Drupal\bootstrap_layout_builder\Element\ContainerWrapper') (Line: 96)
    Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('blb_container_wrapper', Array, 'Drupal\Core\Render\Element\ElementInterface') (Line: 17)
    Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('blb_container_wrapper', Array) (Line: 83)
    Drupal\Component\Plugin\PluginManagerBase->createInstance('blb_container_wrapper', Array) (Line: 166)
    Drupal\Core\Render\ElementInfoManager->createInstance('blb_container_wrapper') (Line: 135)
    Drupal\Core\Render\ElementInfoManager->buildInfo('italiagov') (Line: 91)
    Drupal\Core\Render\ElementInfoManager->getInfo('inline_template') (Line: 356)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
    Drupal\Core\Render\Renderer->render(Array) (Line: 475)
    Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 61)
    __TwigTemplate_fc0c99dc371d9abb47e7cdae4db44138->doDisplay(Array, Array) (Line: 393)
    Twig\Template->yield(Array, Array) (Line: 349)
    Twig\Template->display(Array) (Line: 364)
    Twig\Template->render(Array) (Line: 35)
    Twig\TemplateWrapper->render(Array) (Line: 39)
    twig_render_template('core/modules/node/templates/field--node--title.html.twig', Array) (Line: 348)
    Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 480)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
    Drupal\Core\Render\Renderer->render(Array) (Line: 110)
    Drupal\Core\Entity\Controller\EntityViewController->buildTitle(Array)
    call_user_func_array(Array, Array) (Line: 111)
    Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 859)
    Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 421)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
    Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 627)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 239)
    Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
    call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 186)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 68)
    Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 49)
    Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    
  • 🇯🇴Jordan Rajab Natshah Jordan

    ✅ Released bootstrap_layout_builder-2.2.1
    Issue #3474916 : Changed Bootstrap Styles to ^1.2.0 for the Bootstrap Layout Builder 2.2.x branch to work with Drupal ^10.3 || ^11

    ✅ Released bootstrap_layout_builder-2.1.6
    Issue #3474914 : Changed Bootstrap Styles to ^1.1.0 for the Bootstrap Layout Builder 2.1.x branch to work with Drupal <=10.2

    RenderElement and FormElement base plugin classes are deprecated and renamed to RenderElementBase and FormElementBase
    📌 Rename RenderElement and FormElement plugin abstract classes to RenderElementBase and FormElementBase Fixed

    Better to update to Drupal ^10.3

  • Status changed to Needs review about 2 months ago
  • 🇮🇳India sourav_paul Kolkata

    I can't replicate the issue by following the mentioned steps.

    & I've tested 2.2.x code on D10.3.1 it's woking fine...

    Attaching SS:

  • Status changed to RTBC about 2 months ago
  • Status changed to Fixed about 2 months ago
  • 🇮🇹Italy drp_distruptor Neaples

    Thanks to rajab natshah for making the changes to the version compatibility of Drupal core for the project. I agree with you about upgrading the core to the latest version available (in some cases, I cannot make this).

    sourav_paul as I said, I tested the version 2.1.5 on Drupal 10.3.5 (not the 2.2.x). Anyway, I see that yesterday (Rome) released a new version, I will try it on both of my cases.

  • 🇮🇳India sourav_paul Kolkata

    @drp_distruptor On the project page it is clearly mentioned that module version 2.1 is only compatible with Drupal 10.2 or lower & 2.2 version is only compatible with 10.3 & upper.

    hence, using the version 2.1.5 on Drupal 10.3.5 not make sense.

    Attaching SS:

  • 🇮🇹Italy drp_distruptor Neaples

    Hi @sourav_paul, thanks for your answer. Maybe I'm missing something, but @rajab-natshah made the changes to the version compatibility after this issue, or not?

Production build 0.71.5 2024