Resolved
Overview of the issue
If you are using a page builder in your website, you may notice that if you add some emojis in a block of content, that block won’t be available for translation in the Advanced Translation Editor or Classic Translation Editor.
Workaround
This issue appears because of a table collation conflict. If your server supports the collation utf8mb4_general_ci, you can follow this procedure after making a full backup of your site:
- Open your theme’s functions.php file.
- Add this code:
// Notice admin_init - will only run in backend add_action('admin_init', function() { require_once(ABSPATH.'/wp-admin/includes/upgrade.php'); global $wpdb; $mytables=$wpdb->get_results("SHOW TABLES"); foreach ($mytables as $mytable) { foreach ($mytable as $t) { maybe_convert_table_to_utf8mb4( $t ); } } });
- Visit any page in your site’s backend.
- Remove the code.
Your database tables collation should be utf8mb4_general_ci now, and the content will be available for translation.
In case your site’s database is using latin1 collation, you could apply the following workaround instead:
- Make a full backup of your site before proceeding.
- Go to: https://github.com/interconnectit/Search-Replace-DB.
- Download the ZIP file of the project and unzip it.
- Upload the unzip folder to your WordPress installation using a FTP client.
- Visit the folder – e.g. http://example.com/Search-Replace-DB-master/
- Fill out your database name, server, user and password. You can obtain those values from your wp-config.php file.
- Click and test the connection.
- Go to the bottom and click on the button “Convert to UTF8MB4“.
- Wait for the process to finish.
- Once this is done click “Delete me” button
Our charset was already utf8mb4, but collation was utf8mb4_unicode_520_ci.
We did change the collate to utf8mb4_general_ci. It didn’t solve the problem.
We are still having errors in the backend like
WordPress database error: Could not perform query because it contains invalid data.
Array
(
[language] => fi
[context] => gutenberg-48464
[gettext_context] =>
[domain_name_context_md5] => 6ba2647d7d6fb14b486fdb4c9077674d
[name] => 2aa42ca2d68e9af29e111c198ecf98ee
[value] => 🔗 Kartoitetaan osaamistaso
[status] => 0
[translation_priority] => optional
[allow_empty_value] =>
)
Hello there,
The error does not seem to be exactly the same from this errata. Please, open a ticket in our support forum so we are able to help your better.
Regards
Ha Andrés and thanks for your response.
I was directed here from your support chat. As you can see, the value contains emoji. And I had the same error for multiple different contents, all of which included also an emoji. For me, these problems seem to be closely related.
To be specific, the error message started as “We have detected a problem with some tables in the database. Please contact WPML support to get this fixed.” and was visible in all of the pages of the WP backend.
However, after clicking the close button in the error message, those seem now to been gone.
Thank you, however if the issue remains after applying the fix, we need to investigate it as it may not be slightly different. Could you please open a new ticket as we don’t have the right tools to help you here?
Bonjour, j’ai mis à jour vos droits. Ca devrait fonctionner.
Concernant la procédure je l’avais déjà mis en place, le charset de la ma base est bien modifier mais ca ne change rien.
Merci.
Bonjour,
Si cette procédure ne fonctionne pas, je vous recommande de commencer un chat avec un de nos spécialistes.
Cordialement