Fixed Twitter Connect Issue

MickkD

Member
  • XF\Db\Exception: MySQL query error [1366]: Incorrect string value: '\xF0\x9F\x87\xB0\xF0\x9F...' for column 'location' at row 1
  • src/XF/Db/AbstractStatement.php:212
  • Generated by: Unknown account
  • Oct 30, 2017 at 5:41 PM

Stack trace
INSERT INTO xf_user_profile (`user_id`, `location`, `dob_day`, `dob_month`, `dob_year`, `password_date`, `signature`, `website`, `following`, `ignored`, `avatar_crop_x`, `avatar_crop_y`, `about`, `custom_fields`, `connected_accounts`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(174): XF\Db\AbstractStatement->getException('MySQL query err...', 1366, '22007')
#1 src/XF/Db/Mysqli/Statement.php(69): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1366, '22007')
#2 src/XF/Db/AbstractAdapter.php(69): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(145): XF\Db\AbstractAdapter->query('INSERT INTO xf...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1343): XF\Db\AbstractAdapter->insert('xf_user_profile', Array)
#5 src/XF/Mvc/Entity/Entity.php(1085): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Mvc/Entity/Entity.php(1103): XF\Mvc\Entity\Entity->save(true, false)
#7 src/XF/Service/User/Registration.php(254): XF\Mvc\Entity\Entity->save()
#8 src/XF/Service/ValidateAndSavableTrait.php(40): XF\Service\User\Registration->_save()
#9 src/XF/Pub/Controller/Register.php(277): XF\Service\User\Registration->save()
#10 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Register->actionConnectedAccountRegister(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'ConnectedAccoun...', 'json', Object(XF\Mvc\ParameterBag), '', Object(XF\Pub\Controller\Register), NULL)
#12 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(1844): XF\Mvc\Dispatcher->run()
#14 src/XF.php(328): XF\App->run()
#15 index.php(13): XF::runApp('XF\\Pub\\App')
#16 {main}

Request state
array(4) {
["url"] => string(45) "/register/connected-accounts/twitter/register"
["referrer"] => string(68) "https://*********/register/connected-accounts/twitter/"
["_GET"] => array(1) {
["/register/connected-accounts/twitter/register"] => string(0) ""
}
["_POST"] => array(11) {
["username"] => string(13) "samehstar1976"
["email"] => string(28) "***********"
["dob_month"] => string(1) "8"
["dob_day"] => string(2) "13"
["dob_year"] => string(4) "1976"
["_xfRedirect"] => string(1) "/"
["timezone"] => string(19) "Africa/Johannesburg"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(37) "/register/connected-accounts/twitter/"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
 
Not actually sure this is a bug.

\xF0\x9F\x87\xB0\xF0\x9F is a utf8mb4 sequence so to be getting that error it would suggest that you haven't yet converted your database tables to utf8mb4, yet you have fullUnicode enabled in your config. Is that possible?
 
I will double check the confit file tomorrow.

Would the tables not of been updated when I upgraded to xen2 from xen1

Cheers chris

Mick
 
Just an update on this, I upgraded the mysql database.

But the

$config['fullUnicode'] = true;

Was not in my src/config.php file

But it is now...

Thank you.
 
Yeah this was a bug. Any data which was being pulled directly from the provider API wasn't being cleaned with our normal methods, such as removing invalid utf8 if you don't have utf8mb4 enabled.

Sorted now for the next release. Thanks.
 
Back
Top Bottom