XF 2.0 Emoji Support

Ranger375

Well-known member
So I thought my database was good to go, but apparently it isn't. Can I convert the database if I'm already on Beta 3 and if so, is there a link to the script that needs to be run?
 

Ranger375

Well-known member
I did the above but still receive this error when I try to post emojis on my board:

Code:
XF\Db\Exception: MySQL query error [1366]: Incorrect string value: '\xF0\x9F\x98\x82\xF0\x9F...' for column 'message' at row 1 in src/XF/Db/AbstractStatement.php at line 183
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 66
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 67
XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 143
XF\Db\AbstractAdapter->insert() in src/XF/Search/Source/MySqlFt.php at line 96
XF\Search\Source\MySqlFt->index() in src/XF/Search/Search.php at line 40
XF\Search\Search->index() in src/XF/Behavior/Indexable.php at line 46
XF\Behavior\Indexable->XF\Behavior\{closure}() in src/XF.php at line 242
XF::triggerRunOnce() in src/XF/Mvc/Dispatcher.php at line 137
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1787
XF\App->run() in src/XF.php at line 326
XF::runApp() in index.php at line 13
 

Ranger375

Well-known member
Did you get any errors from the conversion script?
Mike, I did:

Code:
* xf_search_index: MySQL query error [1366]: Incorrect string value: '\xA4u\x00\x008...' for column 'metadata' at row 316481
* xf_snog_applications_positions: MySQL query error [1071]: Specified key was too long; max key length is 767 bytes
* xf_snog_applications_types: MySQL query error [1071]: Specified key was too long; max key length is 767 bytes
 

Ranger375

Well-known member
It looks like the emojis are posting, but the error pops up when I submit a post containing an emoji. Refreshing the thread shows the emojis have been Posted though 🤔
 

Mike

XenForo developer
Staff member
That's the problem then.

The Snog tables are something he would have to address (though it's unlikely they're being used in XF2 now unless he's updated those add-ons). However, the search index error is weird and I'm surprised you could even get that data in there as there's clearly invalid UTF-8 there; I have to assume it's from an add-on. I'd have to recommend emptying the xf_search_index table, re-running the conversion and then reindexing.
 

Case

Well-known member
Sorry to jump in this thread but having a similar emoji issue.

I've converted a backup of my forum to xf2. Currently running beta 3. I've just converted the database as above (no errors) and added the line to config.php. When I try to post an emoji it says "Please enter a valid message". If I post and emoji with normal text only the text is posted.

Is there another step I'm missing to enable emoji support?
 

Ranger375

Well-known member
That's the problem then.

The Snog tables are something he would have to address (though it's unlikely they're being used in XF2 now unless he's updated those add-ons). However, the search index error is weird and I'm surprised you could even get that data in there as there's clearly invalid UTF-8 there; I have to assume it's from an add-on. I'd have to recommend emptying the xf_search_index table, re-running the conversion and then reindexing.
Mike, I will do that. Would dropping the Snog tables be enough to completely remove the addon? (or @Snog )
 

Ranger375

Well-known member
After emptying the table and running the conversion the emojis now work. Only issue was that @Snog 's mod threw up some errors, but I'm hoping that upgrading it will help (waiting on the legacy addon bug to be resolved so I can upgrade).
 
Top