From 0b1bb4f44d0e088e3ba85a3d9231647ad9f0d567 Mon Sep 17 00:00:00 2001 From: Dieter Holvoet Date: Mon, 8 Aug 2022 11:19:30 +0200 Subject: [PATCH 1/2] Set a default account to make sure the correct timezone is set --- src/Boot/DrupalBoot8.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Boot/DrupalBoot8.php b/src/Boot/DrupalBoot8.php index 85b8bcb552..29ea7c8630 100644 --- a/src/Boot/DrupalBoot8.php +++ b/src/Boot/DrupalBoot8.php @@ -248,6 +248,9 @@ public function bootstrapDrupalFull(BootstrapManager $manager): void parent::bootstrapDrupalFull($manager); $this->addDrupalModuleDrushCommands($manager); + + // Set a default account to make sure the correct timezone is set + $this->kernel->getContainer()->get('current_user')->setAccount(new AnonymousUserSession()); } public function addDrupalModuleDrushCommands($manager): void From 6e29e4ff381cb9f0c856de4f2e8f54dc00f9a95d Mon Sep 17 00:00:00 2001 From: Dieter Holvoet Date: Mon, 8 Aug 2022 11:24:08 +0200 Subject: [PATCH 2/2] Add missing use statement --- src/Boot/DrupalBoot8.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Boot/DrupalBoot8.php b/src/Boot/DrupalBoot8.php index 29ea7c8630..0c610eaf2c 100644 --- a/src/Boot/DrupalBoot8.php +++ b/src/Boot/DrupalBoot8.php @@ -7,6 +7,7 @@ use Drupal\Core\Database\Database; use Drupal\Core\Render\HtmlResponse; use Drupal\Core\DrupalKernel; +use Drupal\Core\Session\AnonymousUserSession; use Drush\Config\ConfigLocator; use Drush\Drupal\DrushLoggerServiceProvider; use Drush\Drupal\DrushServiceModifier;