Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 6 replies, has 2 voices.

Last updated by Andrey 2 months, 2 weeks ago.

Assisted by: Andrey.

Author Posts
August 31, 2024 at 3:10 pm #16127823

emmanuelS-7

<b>Background of the issue: </b>
I'm trying to fix a database error detected by WPML with the following message: WordPress Database Error: The query could not be performed because it contains invalid data. Array ( [language] => en [context] => ajax-search-pro [gettext_context] => [domain_name_context_md5] => 663dd83aba7753773764b28026fa9872 [name] => actualites [value] => Actualités [status] => 0 [translation_priority] => optional [allow_empty_value] => )

<b>Symptoms: </b>
WordPress Database Error: The query could not be performed because it contains invalid data.

<b>Questions: </b>
How can I fix the database error detected by WPML?

CleanShot 2024-08-31 at 17.08.31 2.png
August 31, 2024 at 9:31 pm #16128171

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

It looks like a bug in WP (https://core.trac.wordpress.org/ticket/59868) may trigger this warning when WPML saves a string with emojis.

The cause of the issue is mixed database table collations. You can reach out to your host/developer by following these steps:

- Make sure you have a complete database backup
- Go to the database and check the columns of the wp_icl_strings table.
- All columns should have the same collation, and recommended is utf8mb4

August 31, 2024 at 10:15 pm #16128196

emmanuelS-7

Thanks for the informations.

I could try to fix the DB collation issue using this plugin:
https://wordpress.org/plugins/database-collation-fix/

There's 2 options for utf8mb4:
- utf8mb4_unicode_ci
- utf8mb4_general_ci

An idea which one fits best please?

[Edit] Or i could edit the DB Table using Adminer from within WP.
But i'm not sure how to proceed, most of the table columns already are in utf8mb4_unicode_ci (some are unsigned and one is empty).

CleanShot 2024-09-01 at 00.11.30.jpg
September 1, 2024 at 12:59 am #16128281

emmanuelS-7

I edited the table using Adminer, but the collation is already set to utf8mb4_unicode_ci
I also edited directly the entry mentioned by the WPML error msg
I tried to delete the string in WPML
Nothing works, the WPML error is still displayed in red in the WP backend.

September 2, 2024 at 2:59 pm #16132582

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for your feedback.

Have you also checked the columns collation of the wp_icl_strings table?

If you close the message, will it still appear? If it appears again, please apply the workaround mentioned on this page. (https://wpml.org/errata/using-emojis-with-page-builders-might-make-the-content-not-available-for-translation/)

Please backup your database before making any changes.

September 4, 2024 at 4:13 pm #16141896

emmanuelS-7

Hi,

Yes the wp_icl_strings table was already set to utf8mb4_unicode_ci, as mentioned in my previous message.

I simply closed the WPML error message displayed in WP backend, as you suggested, and it doesn't appear again.

We'll see in the future.

Thanks for your help.

September 5, 2024 at 12:14 pm #16144985

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Then, it should be fine. If the issue arises, feel free to open a new support ticket.