From a4853bc2fe5e654ed28c87c093cf2885de5fa956 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Sun, 20 Oct 2024 00:05:25 +1300 Subject: [PATCH] DOC Add entry about utf8mb4 encoding update to changelog --- en/08_Changelogs/6.0.0.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/en/08_Changelogs/6.0.0.md b/en/08_Changelogs/6.0.0.md index 6860660b..cbcc5015 100644 --- a/en/08_Changelogs/6.0.0.md +++ b/en/08_Changelogs/6.0.0.md @@ -30,6 +30,7 @@ title: 6.0.0 (unreleased) - [General changes](#api-general) - [Other changes](#other-changes) - [MySQL 5 no longer supported](#mysql-5-support) + - [MySQL now defaults to utf8mb4](#mysql-utf8mb4) - [`DBDecimal` default value](#dbdecimal-default-value) - [`RedirectorPage` validation](#redirectorpage-validation) - [Full list of removed and changed API (by module, alphabetically)](#api-removed-and-changed) @@ -716,11 +717,32 @@ If you reference any of these classes in your project or module, most likely in MySQL 5.6 and 5.7 are no longer supported. The minimum supported version is MySQL 8.0. We support and test against the latest LTS releases of MySQL and MariaDB. +### MySQL now defaults to utf8mb4 {#mysql-utf8mb4} + +MySQL will now use `utf8mb4` by default rather than plain `utf8`. This provides better support for emojis and other special characters. + +Depending on when you created your Silverstripe CMS project, you may already be using `utf8mb4` as the default encoding. The `silverstripe/recipe-core` recipe has included a configuration file setting your database settings to `utf8mb4` for a few years. + +When upgrading your Silverstripe CMS project, review the `app/_config/mysite.yml` file and remove the following lines if they exist: + +```yml +# UTF8MB4 has limited support in older MySQL versions. +# Remove this configuration if you experience issues. +--- +Name: myproject-database +--- +SilverStripe\ORM\Connect\MySQLDatabase: + connection_charset: utf8mb4 + connection_collation: utf8mb4_unicode_ci + charset: utf8mb4 + collation: utf8mb4_unicode_ci +``` + ### `DBDecimal` default value {#dbdecimal-default-value} Previously if an invalid default value was provided for a [`DBDecimal`](api:SilverStripe\ORM\FieldType\DBDecimal) database column, it would silently set the defalt value to `0`. This will now throw an exception instead, so that you're aware your configured value is invalid and can correct it. -## `RedirectorPage` validation +### `RedirectorPage` validation [`RedirectorPage`](api:SilverStripe\CMS\Model\RedirectorPage) now uses the [`Url` constraint](https://symfony.com/doc/current/reference/constraints/Url.html) from `symfony/validator` to validate the `ExternalURL` field. It will no longer add `http://` to the start of URLs for you if you're missing a protocol - instead, a validation error message will be displayed.