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.
When running "drush updb" I got this error message:
LogicException: Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use [error]
renderPlain()/renderRoot() or #lazy_builder/#pre_render instead. in
/var/www/drupal/web/core/lib/Drupal/Core/Render/Renderer.php:241
Stack trace:
#0 /var/www/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#1 /var/www/drupal/web/modules/contrib/xmlsitemap/xmlsitemap.install(35): Drupal\Core\Render\Renderer->render(Array)
#2 [internal function]: xmlsitemap_requirements('update')
#3 /var/www/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('xmlsitemap_requ...', Array)
#4 /var/www/drupal/web/core/includes/update.inc(98): Drupal\Core\Extension\ModuleHandler->invokeAll('requirements', Array)
#5 /var/www/drupal/vendor/drush/drush/commands/core/drupal/update.inc(203): update_check_requirements()
#6 /var/www/drupal/vendor/drush/drush/commands/core/drupal/update.inc(134): drush_update_check_requirements()
#7 /var/www/drupal/vendor/drush/drush/commands/core/core.drush.inc(462): update_main()
#8 /var/www/drupal/vendor/drush/drush/includes/command.inc(422): drush_core_updatedb()
#9 /var/www/drupal/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#10 /var/www/drupal/vendor/drush/drush/includes/command.inc(199): drush_command()
#11 /var/www/drupal/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#12 /var/www/drupal/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#13 /var/www/drupal/vendor/drush/drush/drush.php(12): drush_main()
#14 {main}
As the message suggested, I tried changing the ->render()
calls to ->renderPlain()
in xmlsitemap.install
and after that everything worked fine again.
Attaching patch in comment.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2956643-fix-requirement-rendering.patch | 2.41 KB | Dave Reid |
| |||
#2 | render-calls-in-install-file-2956643-1.patch | 1.73 KB | Rade |
Comments
Comment #2
Rade CreditAttribution: Rade at Siili Solutions commentedPatch attached against latest dev version.
Comment #3
Dave ReidFixed a couple of things that were also not rendered correctly.
Comment #5
Dave Reid