Unable to see Emojis in Blogposts, Forums and Messages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Won't Fix
|
Low
|
Gold |
Bug Description
Mahara Version: 20.10.0
Operating System: Ubuntu 18.04.5 LTS
Database: MySQL 5.7
After upgrading from Mahara version 18.04 to 20.10 we ran into a small problem regarding Emojis.
Emoji's in Messages, Blogposts and Forums turned into '?'
Using the steps from https:/
For Blogs and Forum posts:
ALTER TABLE interaction_
ALTER TABLE artefact_
ALTER TABLE artefact default charset=utf8mb4 collate=
ALTER TABLE artefact modify column description text character set utf8mb4 collate utf8mb4_unicode_ci null;
For Messages:
ALTER TABLE maharadb.
ALTER TABLE maharadb.
This solved our problem
Regards,
Philippe and Jochen
Changed in mahara: | |
status: | New → Confirmed |
importance: | Undecided → Low |
tags: | added: bite-sized |
Changed in mahara: | |
assignee: | nobody → Gold (gold.catalyst) |
Changed in mahara: | |
status: | Confirmed → In Progress |
Changed in mahara: | |
status: | In Progress → Won't Fix |
Thanks Philippe and Jochen for providing the solution.
This does resolve the issue for the tables you found. However this an issue with all fields that have content from TinyMCE. If you want to solve this issue for all tables you may want to give the following a go.
Upgrading MySQL to the utf8mb4 character set is not an operation that is supported by Mahara as it is a database-specific operation. For this reason we will set this bug to 'Won't fix'. Short of upgrading one table at a time and dealing with foreign key constraints, the easiest way appears to be to
1. export the DB without character set details
2. remove character set and collation details from the table and column definitions
3. create a new database with the correct character set and collation
4. import the database specifying the explicit character set.
Details that would help you achieve that follow. Please test this process thoroughly and consult your database expert:
# Step 1 - dump the database without character set details.
mysqldump -u maharauser -p -h localhost --no-tablespaces --skip-set-charset -r mahara-dump.sql maharadb
# Step 2 - clear out the character set and collation details from the table and column definitions utf8_bin/ /g' mahara-dump.sql
sed -i 's/ DEFAULT CHARSET=utf8 COLLATE=
sed -i 's/ COLLATE utf8_bin//g' mahara-dump.sql
# Step 3 - drop and recreate the database with the correct character set and collation.
mysql> drop database maharadb;
mysql> create database maharadb character set UTF8mb4 collate utf8mb4_bin;
# Step 4 - import the database specifying the explicit character set. character- set=utf8mb4 maharadb < mahara-dump.sql
mysql -u maharauser -p -h localhost --default-
# Step 5 - test your site.
Testing:
* Stand up an old version of Mahara with a version of the DB that doesn't support emojis.
mysql> drop database maharadb; create database maharadb character set UTF8 collate utf8_bin;
1. Install Mahara
2. Create a journal entry with an emoji in the journal 'Entry'
3. Check that the emoji isn't stored correctly
4. Perform the upgrade steps above
5. Log in and edit the journal entry and add an emoji
6. Check that the new emoji saved and displays
7. Edit the journal entry and check that the new emoji is still visible in the editor.