diff -u b/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php b/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php --- b/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php +++ b/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php @@ -542,7 +542,8 @@ foreach ($render_id_values as $key => $render_id_value) { $error .= str_replace('%', '', $key) . ": $key, "; } - $this->getLogger()->error("$error. Aborting rendering.", $render_id_values); + $error = $this->t("$error. Aborting rendering."); + $this->getLogger()->error($error, $render_id_values); return TRUE; } return FALSE; diff -u b/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php b/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php --- b/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php +++ b/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php @@ -69,6 +69,10 @@ * The logger service. */ public function __construct(AccountInterface $current_user, LoggerInterface $logger) { + if (!$current_user) { + @trigger_error('The current_user service must be passed to BlockComponentRenderArray::__construct(), it is required before Drupal 9.0.0.', E_USER_DEPRECATED); + $current_user = \Drupal::currentUser(); + } $this->currentUser = $current_user; $this->logger = $logger; }