XF 2.0 Emoji - MySQL Post Errors

thenashy

Active member
We have just created a dev install to get ready to move our main site onto XF2, and have run into a problem with getting emojis working. I've converted the DB, and enabled support via config. Would appreciate any help with the errors below. I've probably done something dumb though.

  • XF\Db\Exception: MySQL query error [1366]: Incorrect string value: '\xF0\x9F\x98\x82\xE2\x9D...' for column 'message' at row 1
  • src/XF/Db/AbstractStatement.php:212

Stack trace
INSERT INTO xf_post (`thread_id`, message_state, user_id, username, message, embed_metadata, post_date, post_id, ip_id, attach_count, likes, like_users, warning_id, warning_message, last_edit_date, last_edit_user_id, edit_count, position) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1366, '22007')
#1 src/XF/Db/Mysqli/Statement.php(78): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1366, '22007')
#2 src/XF/Db/AbstractAdapter.php(79): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(161): XF\Db\AbstractAdapter->query('INSERT INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1403): XF\Db\AbstractAdapter->insert('xf_post', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1135): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Service/Thread/Replier.php(167): XF\Mvc\Entity\Entity->save(true, false)
#7 src/XF/Service/ValidateAndSavableTrait.php(40): XF\Service\Thread\Replier->_save()
#8 src/XF/Pub/Controller/Thread.php(440): XF\Service\Thread\Replier->save()
#9 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Thread->actionAddReply(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'add-reply', 'json', Object(XF\Mvc\ParameterBag), 'forums', Object(XF\Pub\Controller\Thread), NULL)
#11 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#13 src/XF.php(329): XF\App->run()
#14 index.php(13): XF::runApp('XF\\Pub\\App')
#15 {main}

array(4) {
["url"] => string(69) "/threads/maintenance-XXX-info-admin-to-do-list-pg9.20106/add-reply"
["referrer"] => string(84) "http://****/threads/maintenance-XXX-info-admin-to-do-list-pg9.20106/"
["_GET"] => array(0) {
}
["_POST"] => array(9) {
["message_html"] => string(197) "<p>😂❤️😎❤️🤣❤️😢😁😶😁😂😍🍑🥥🍑🍏🍌🍈🍍🍈🍐🍒🍐🍌🎎🎀🎎🎋✨🎄🎈🎄🎇🎏🎋🎊🎙️🎤🎙️📻🎶🔕🎙️🔕</p>"
["attachment_hash"] => string(32) "7607e45554fa1511ac68c7a0766c4b94"
["attachment_hash_combined"] => string(87) "{"type":"post","context":{"thread_id":20106},"hash":"7607e45554fa1511ac68c7a0766c4b94"}"
["last_date"] => string(10) "1351332097"
["last_known_date"] => string(10) "1544126040"
["_xfToken"] => string(8) "****"
["_xfRequestUri"] => string(60) "/threads/maintenance-XXX-info-admin-to-do-list-pg9.20106/"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
 
The error normally indicates that the DB has not been converted. Please double check that it is really utf8mb4 and that you have fullUnicode in config.php.
 
Last edited:
Back
Top Bottom