Wiki-Plugin: Error Message when save Page with emojis

For MySQL, you can run the following three statements.

ALTER TABLE wikipage CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wikipage_editions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wikipage_has_files CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Or could patch your code or create a pull request with the entire snippet below.

File Schema/Mysql.php:

const VERSION = 9;

// Allow unicode emojis in wikipages
function version_9(PDO $pdo)
{
    $pdo->exec('ALTER TABLE wikipage CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
    $pdo->exec('ALTER TABLE wikipage_editions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
    $pdo->exec('ALTER TABLE wikipage_has_files CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
}

For PostgreSQL, I don’t have any information at hand, as I don’t use nor have it. But I assume it would require a similar patch.

4 Likes