Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-07-22 15:13:43

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

rvm_utf8_to_utf8mb4 (v0.2)

This plugin helps you to change the character set in tables, created by Textpattern versions older than 4.6 and/or MySQL versions older than 5.5.3 from ‘utf8’ to ‘utf8mb4’, which allows you to use the full range of UTF-8 characters, including emojis.

Note that if you still use the ‘latin1’ character set, you have to use the rvm_latin1_to_utf8 plugin to change the character set to ‘utf8’ first.

Please read the plugin documentation carefully before using this plugin.

Download

Features:

  • After plugin installation, just 2 clicks are needed to do let it do its job.
  • Can handle textpattern tables with modified columns.
  • Additional tables, created by plugins can also be upgraded (optional).
  • Detailed documentation in the plugin help.

Changelog:

  • version 0.1 (2017-07-22)
  • version 0.2 (2017-08-03)
    • don’t set default values on column types that do not support this

Offline

#2 2017-08-02 21:45:35

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: rvm_utf8_to_utf8mb4 (v0.2)

On my local server, I’ve tried this plugin and I’m not sure if it worked properly.
After hitting the “Continue” button, I got a few alerts with the following message:

User_Error “BLOB, TEXT, GEOMETRY, or JSON column ‘Body’ can’t have a default value”

The same message gets repeated for the following columns: css, message, description, Form, caption, data, url, refer, user_html, description, val.

If I look at the database on adminer, I see that some tables got a new collation (utf8mb4_unicode_ci) while others still have utf8_general_ci as collation.

Also, when I try to save an article with some emojis on it, I get this alert:

User_Error “Incorrect string value: ‘\xF0\x9F\x8E\x9B\xF0\x9F…’ for column ‘Body’ at row 1”.

Some extra info for you:

$ mysql --version
mysql  Ver 14.14 Distrib 5.7.18, for Linux (i686) using  EditLine wrapper

PS: btw, in the plugin page on your website, the “info” link for this plugin is not pointing to the correct URL (ie. this thread).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2017-08-03 17:18:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_utf8_to_utf8mb4 (v0.2)

You did create a backup first, right? Restore it and edit textpattern/config.php and remove the utf8mb4 line.

What do the following SQL commands show, if you run them via PHPmyadmin:

SHOW COLUMNS FROM txp_css;
SHOW CREATE TABLE txp_css;

PS. info link fixed. Thanks!

Offline

#4 2017-08-03 19:25:22

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_utf8_to_utf8mb4 (v0.2)

I’ve uploaded version 0.2 which should fix the issue manique mentioned. Can you test if it works for you after first restoring TXP to it’s original state?

Offline

#5 2017-08-03 23:44:42

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: rvm_utf8_to_utf8mb4 (v0.2)

@ruud, after running v0.2, I’m getting the same alert messages when running the plugin and when trying to save an article with emojis. Only difference this time are the columns (I didn’t take note of all of them this time, but if you need it, let me know).

Also, I’ve made `config.php` writable temporarily, just to test that too, and I can confirm that after the plugin ran successfully, `$txpcfg[‘dbcharset’]` is still set to `utf8` (a bug?).

FYI, here is how the database looks before and after running the plugin.

Before:

After:

I’m not sure if it’s related to the issue (but I’d bet it is), but some content-related tables (like `textpattern`) are still shown as `utf8_general_ci’ while others non-content-related tables (like `txp_discuss_nonce`) are shown as `utf8mb4_unicode_ci`.

Also, in case it’s still helpful, here’s the output you asked for the MySQL commands:

SHOW COLUMNS FROM txp_css;
Field Type Null Key Default Extra
name varchar(255) NO UNI NULL
css mediumtext NO NULL
SHOW CREATE TABLE txp_css;
Table Create Table
txp_css CREATE TABLE `txp_css` ( `name` varchar(255) NOT NULL, `css` mediumtext NOT NULL, UNIQUE KEY `name` (`name`(250))
) ENGINE=MyISAM DEFAULT CHARSET=utf8

La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2017-08-05 07:59:41

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_utf8_to_utf8mb4 (v0.2)

Weird. Can you send me a dump of your database (before running the plugin), so I can try to figure out what’s happening.

Offline

#7 2017-08-05 18:09:14

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: rvm_utf8_to_utf8mb4 (v0.2)

Sent!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB