From b097a5866e5d2a2871b939b1993de6885a4f6ec3 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Thu, 29 Aug 2024 09:02:04 +1000 Subject: [PATCH 1/2] Explicitly set charset and collation for Drupal sites --- assets/settings.lagoon.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/settings.lagoon.php b/assets/settings.lagoon.php index f6bfaf7..bebe9ea 100644 --- a/assets/settings.lagoon.php +++ b/assets/settings.lagoon.php @@ -30,6 +30,8 @@ } // Lagoon database connection. +// If you require a specific charset or collation for your site, +// copy, update and add this paragraph to your all.settings.php file. if (getenv('LAGOON')) { $databases['default']['default'] = [ 'driver' => 'mysql', @@ -38,6 +40,8 @@ 'password' => getenv('MARIADB_PASSWORD') ?: 'drupal', 'host' => getenv('MARIADB_HOST') ?: 'mariadb', 'port' => getenv('MARIADB_PORT') ?: 3306, + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_general_ci', 'prefix' => '', ]; } From f3042068e6b0ce09ff1dc401aa3b388415352aed Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Thu, 29 Aug 2024 09:05:41 +1000 Subject: [PATCH 2/2] chore: use env var overrides --- assets/settings.lagoon.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/settings.lagoon.php b/assets/settings.lagoon.php index bebe9ea..89ce77c 100644 --- a/assets/settings.lagoon.php +++ b/assets/settings.lagoon.php @@ -30,7 +30,7 @@ } // Lagoon database connection. -// If you require a specific charset or collation for your site, +// If you require a specific charset or collation for your site, // copy, update and add this paragraph to your all.settings.php file. if (getenv('LAGOON')) { $databases['default']['default'] = [ @@ -40,8 +40,8 @@ 'password' => getenv('MARIADB_PASSWORD') ?: 'drupal', 'host' => getenv('MARIADB_HOST') ?: 'mariadb', 'port' => getenv('MARIADB_PORT') ?: 3306, - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_general_ci', + 'charset' => getenv('MARIADB_CHARSET') ?: 'utf8mb4', + 'collation' => getenv('MARIADB_COLLATION') ?: 'utf8mb4_general_ci', 'prefix' => '', ]; }