Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal 8.1.7
Bootstrap 8.x-3.x-dev (0c541a1)
Example 1 - Saving Bootstrap theme settings page:
The website encountered an unexpected error. Please try again later.
LogicException: Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead. in Drupal\Core\Render\Renderer->doRender() (line 241 of core/lib/Drupal/Core/Render/Renderer.php).
Drupal\Core\Render\Renderer->render(Array) (Line: 97)
Drupal\bootstrap\Plugin\Setting\SettingBase->getElement(Array, Object) (Line: 25)
Drupal\bootstrap\Plugin\Setting\SettingBase->alterForm(Array, Object, NULL) (Line: 49)
Drupal\bootstrap\Plugin\Setting\Components\Region\RegionWells->alterForm(Array, Object) (Line: 38)
Drupal\bootstrap\Plugin\Form\SystemThemeSettings->alterForm(Array, Object, NULL) (Line: 207)
Drupal\bootstrap\Bootstrap::alter('bootstrap_form_system_theme_settings_alter', Array, Object, NULL) (Line: 74)
bootstrap_form_system_theme_settings_alter(Array, Object) (Line: 326)
Drupal\system\Form\ThemeSettingsForm->buildForm(Array, Object, 'bootstrap')
call_user_func_array(Array, Array) (Line: 512)
Drupal\Core\Form\FormBuilder->retrieveForm('system_theme_settings', Object) (Line: 271)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 627)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Example 2 - Submitting comments:
LogicException: Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead. in Drupal\Core\Render\Renderer->doRender() (line 241 of core/lib/Drupal/Core/Render/Renderer.php).
Drupal\Core\Render\Renderer->render(Array) (Line: 478)
Drupal\bootstrap\Utility\Element->render() (Line: 155)
Drupal\bootstrap\Plugin\ProcessManager::processInputGroups(Object, Object, Array) (Line: 82)
Drupal\bootstrap\Plugin\ProcessManager::process(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 979)
Drupal\Core\Form\FormBuilder->doBuildForm('comment_media_comment_form', Array, Object) (Line: 1042)
Drupal\Core\Form\FormBuilder->doBuildForm('comment_media_comment_form', Array, Object) (Line: 1042)
Drupal\Core\Form\FormBuilder->doBuildForm('comment_media_comment_form', Array, Object) (Line: 555)
Drupal\Core\Form\FormBuilder->processForm('comment_media_comment_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object) (Line: 251)
Drupal\comment\Controller\CommentController->getReplyForm(Object, Object, 'field_media_comments', NULL)
call_user_func_array(Array, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 627)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
..and maybe other places I haven't found yet?
Comment | File | Size | Author |
---|---|---|---|
#12 | use_renderplain_instead-2779295-12.patch | 634 bytes | jasonsavino |
#7 | use_renderplain_instead-2779295-7.patch | 9.14 KB | markhalliwell |
Comments
Comment #2
steveoliver CreditAttribution: steveoliver commentedSpecified Bootstrap version commit id.
Comment #3
steveoliver CreditAttribution: steveoliver commentedFixes issue for Examples 1 and 2.
Comment #4
markhalliwellAs stated in IRC, I haven't encountered these errors in either scenario.
@steveoliver suggests that it may be some other contrib code interfering with this.
Regarding the patch, I'd rather not change the method called in
render
and instead add a new subsequentrenderPlain
, andrenderRoot
wrappers. I can do this is a separate issue.This one should likely be focused on replacing existing calls to this method with the appropriate method call.
Comment #5
markhalliwellOk. I added those methods. I'm going to work on trying to replace all these instances with the proper call and upload a patch here for you to try.
Comment #6
markhalliwellComment #7
markhalliwellOk, here's a more comprehensive patch. See if this works.
Note: this includes a few changes to simplify syntax with the addition of the related issue I'm attaching now.
Edit: you should download a new dev before applying this patch (if that wasn't obvious)
Comment #8
steveoliver CreditAttribution: steveoliver commentedlooks good, works as expected!
Comment #10
markhalliwellComment #12
jasonsavino CreditAttribution: jasonsavino as a volunteer commentedDrupal 8.4.2
Bootstrap 8.x-3.7
I found a similar issue when adding Search via Context. I was able to fix it and have included the patch file.
Comment #13
BigEd CreditAttribution: BigEd commented@jasonsavino Thanks I had the same issue with Search via Context, I also was having an issue in the region of the block but this solved my issue. Thanks.