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 7 replies, has 3 voices.

Last updated by Stavros 11 months, 3 weeks ago.

Assigned support staff: Raja Mohammed.

Author Posts
November 27, 2019 at 11:14 am #5028449

zsoltE-2

Hi,
I accidentaly closed my previous ticket (https://wpml.org/forums/topic/not-valid-collation/).

Now I wanted to install again. But received the following errors:
Table 'database.wp_icl_languages' doesn't exist
and it goeas like this with many different tables many times.

And finally:
PHP Fatal error: COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4' in /usr/share/nginx/html/wp-content/plugins/sitepress-multilingual-cms/inc/setup/sitepress-schema.php on line 362

The Utf8mb4 default collation is the utf8mb4_0900_ai_ci in mysql server( Ver 8.0.17 ). It seemst that WPML should not force utf8_general_ci collation. What do you think? Is it possible? Or is there any other solution for that?

Best regards, Zsolt

November 27, 2019 at 11:38 am #5028593

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Kindly apologize, There is some network issue on my side that disconnected the chat.
The issue was earlier reported and fixed in version 4.2.3. If this is happening with the latest version of WPML It would be better if you can send me a snapshot copy of your site so that I can look into details about the issue.

You can use the Duplicator plugin to create a snapshot of the site and share the package link with me http://wordpress.org/plugins/duplicator/.

I have enabled private fields to securely share the details.

Kind regards
Raja

November 27, 2019 at 12:09 pm #5028785

zsoltE-2

Hi Raja,
That's ok. Duplicator dont work at this moment (problem fixing is in process).

I created the tables manually, then put the following line into the sitepress-setup.class.php (Sitepress_Setup::get_charset_collate() method):

return 'DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci';

Now WPML works.

I also tried to add the following line to wp-config.php:

define('DB_COLLATE', 'utf8mb4_unicode_520_ci');

But this did not worked, since WPML disregards the DB_COLLATE constant.

I think this is a bug in WPML, and you should report is. What do you think?

Regards, Zsolt

November 27, 2019 at 12:23 pm #5028853

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for the update Zsolt, You are right this is something that needs to be escalated maybe I will try to reproduce in a fresh installation.

WPML fetches the charset collate from wp_posts first and then moves to the constant DB_COLLATE, that's the reason the DB_COLLATE is ignored since the issue is triggered at the first check.

Thanks for reporting. I will report this to the concerned team.

kind regards
Raja

November 30, 2019 at 5:16 am #5046327

zsoltE-2

Hi,

I would like to know that what solution will be included in next version.
Now I am testing it in develper site, but I would like to move to a production site. If I receive the next version of WPML, it would be hard to me if it will broke my production site.

Zsolt

December 2, 2019 at 8:42 am #5051371

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello Zsolt.

I am unable to reproduce the issue on a fresh installation. It would be better if you can send me a snapshot copy of your site so that I can look into details about the issue and escalate accordingly

You can use the Duplicator plugin to create a snapshot of the site and share the package link with me http://wordpress.org/plugins/duplicator/. I have enabled private fields to securely share details. I will override the changes done on the code to reproduce the issue.

Kind regards
Raja

December 10, 2019 at 1:12 pm #5100073

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello zsolt,

I am unable to reproduce the issue using the duplicator copy. I tried
- Removed the return code from sitepress-setup.class.php (Sitepress_Setup::get_charset_collate() method):

return 'DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci';

- Removed the define('DB_COLLATE', 'utf8mb4_unicode_520_ci'); from wp-config.php
- Reset WPML and completely removed it
- Activated WPML as a fresh instalaltion, No errors encountered

This may be specific to your environment. I would suggest following the fix as mentioned here hidden link
The fix requires access to MySQL config. A similar fix has been posted on other forums as well. In my opinion, this is something not specific to WPML

Kind regards
Raja

March 26, 2020 at 11:24 am #5768537

Stavros

this worked for me too!

    //return $charset_collate;
    return 'DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci';

but now i have two different types of tables in my db

InnoDB utf8_general_ci
and
InnoDB utf8mb4_unicode_520_ci