User Essentials

User Essentials [Paid] 4.4.1

No permission to buy ($35.00)
@Xon @AddonsLab

We're using both this and [AL] Location Custom Field with the location field set to required. We're getting this error when attempting to disable members.

Not sure who's issue this is, or whether it's been fixed yet. We are running AL Core 1.5.5, but we have not yet disabled the Legacy Class Extension Hack.

Code:
Server error log

    XF\PrintableException: Job SV\UserEssentials:DisableUsers: Location: Please enter a value for the required field. src/XF/Mvc/Entity/Entity.php:1218

    Generated by: Unknown account Aug 9, 2022 at 6:11 PM

Stack trace

#0 src/XF/Service/User/Avatar.php(477): XF\Mvc\Entity\Entity->save()
#1 src/addons/SV/UserEssentials/Service/User/DisableUser.php(340): XF\Service\User\Avatar->deleteAvatar()
#2 src/addons/SV/UserEssentials/Service/User/DisableUser.php(208): SV\UserEssentials\Service\User\DisableUser->removeAvatar()
#3 src/addons/SV/UserEssentials/Service/User/DisableUser.php(150): SV\UserEssentials\Service\User\DisableUser->applyOptions()
#4 src/addons/SV/UserEssentials/Job/DisableUsers.php(89): SV\UserEssentials\Service\User\DisableUser->disableUser(true)
#5 src/XF.php(625): SV\UserEssentials\Job\DisableUsers->SV\UserEssentials\Job\{closure}()
#6 src/addons/SV/UserEssentials/Job/DisableUsers.php(90): XF::asVisitor(Object(SV\DailyStatistics\XF\Entity\User), Object(Closure))
#7 src/addons/SV/UserEssentials/Job/DisableUsers.php(76): SV\UserEssentials\Job\DisableUsers->disableUser(Object(SV\UserEssentials\Entity\UserDisable))
#8 src/XF/Job/AbstractRebuildJob.php(47): SV\UserEssentials\Job\DisableUsers->rebuildById(7)
#9 src/XF/Job/Manager.php(260): XF\Job\AbstractRebuildJob->run(8)
#10 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#11 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#12 job.php(43): XF\Job\Manager->runQueue(false, 8)
#13 {main}

Request state

array(4) {
  ["url"] => string(13) "/xf22/job.php"
  ["referrer"] => string(71) "https://domain.com/search-forums/forum.11/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
@Xon @AddonsLab

We're using both this and [AL] Location Custom Field with the location field set to required. We're getting this error when attempting to disable members.

Not sure who's issue this is, or whether it's been fixed yet. We are running AL Core 1.5.5, but we have not yet disabled the Legacy Class Extension Hack.

Code:
Server error log

    XF\PrintableException: Job SV\UserEssentials:DisableUsers: Location: Please enter a value for the required field. src/XF/Mvc/Entity/Entity.php:1218

    Generated by: Unknown account Aug 9, 2022 at 6:11 PM

Stack trace

#0 src/XF/Service/User/Avatar.php(477): XF\Mvc\Entity\Entity->save()
#1 src/addons/SV/UserEssentials/Service/User/DisableUser.php(340): XF\Service\User\Avatar->deleteAvatar()
#2 src/addons/SV/UserEssentials/Service/User/DisableUser.php(208): SV\UserEssentials\Service\User\DisableUser->removeAvatar()
#3 src/addons/SV/UserEssentials/Service/User/DisableUser.php(150): SV\UserEssentials\Service\User\DisableUser->applyOptions()
#4 src/addons/SV/UserEssentials/Job/DisableUsers.php(89): SV\UserEssentials\Service\User\DisableUser->disableUser(true)
#5 src/XF.php(625): SV\UserEssentials\Job\DisableUsers->SV\UserEssentials\Job\{closure}()
#6 src/addons/SV/UserEssentials/Job/DisableUsers.php(90): XF::asVisitor(Object(SV\DailyStatistics\XF\Entity\User), Object(Closure))
#7 src/addons/SV/UserEssentials/Job/DisableUsers.php(76): SV\UserEssentials\Job\DisableUsers->disableUser(Object(SV\UserEssentials\Entity\UserDisable))
#8 src/XF/Job/AbstractRebuildJob.php(47): SV\UserEssentials\Job\DisableUsers->rebuildById(7)
#9 src/XF/Job/Manager.php(260): XF\Job\AbstractRebuildJob->run(8)
#10 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#11 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#12 job.php(43): XF\Job\Manager->runQueue(false, 8)
#13 {main}

Request state

array(4) {
  ["url"] => string(13) "/xf22/job.php"
  ["referrer"] => string(71) "https://domain.com/search-forums/forum.11/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
I think the bug is it was setting the custom field to blank rather than removing it. Can you open a ticket on my site so I can send you a build which may fix this?
 
Summary:
Error when using some emojis in the context of a thread title.
User Essentials addon attempts to update the 'content_title' field of the user logging function of the addon.
Results with "Incorrect String Value" when attempting to save new content to the 'xf_sv_user_log'.'content_title' field.

Tested Under: (nginx staging/test server, but confirmed on production system with similar attributes)
User Essentials: 4.2.9 ⇒ 4.2.11 with no change.
PHP 8.0.23
XF 2.2.10 PL1
MariaDB: 10.3.36

Client(s):
Tested on Mobile/Desktop, Safari/Chrome, etc. Results are the same.

Steps to reproduce:
1. Create a new thread with an emoji in the title. <or>
2. Edit an existing thread and insert an emoji in the title.

Stack Trace:
Code:
XF\Db\Exception: MySQL query error [1366]: Incorrect string value: '\xF0\x9F\x98\x86' for column `s3prod`.`xf_sv_user_log`.`content_title` at row 1 src/XF/Db/AbstractStatement.php:230
Generated by: UserAccount Oct 17, 2022 at 4:50 PM

INSERT  INTO `xf_sv_user_log` (`content_type`, `content_id`, `user_id`, `ip_address`, `content_user_id`, `content_username`, `content_title`, `content_url`, `discussion_content_type`, `discussion_content_id`, `action`, `action_params`, `user_log_id`, `log_date`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL query err...', 1366, '22007')
#1 src/XF/Db/Mysqli/Statement.php(79): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1366, '22007')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(220): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1516): XF\Db\AbstractAdapter->insert('xf_sv_user_log', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1248): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/SV/UserEssentials/UserLog/AbstractHandler.php(127): XF\Mvc\Entity\Entity->save()
#7 src/addons/SV/UserEssentials/UserLog/AbstractHandler.php(72): SV\UserEssentials\UserLog\AbstractHandler->log(Object(SV\BookmarkEssentials\XF\Entity\Post), 'edit', Array, Object(SV\BookmarkEssentials\XF\Entity\User))
#8 src/addons/SV/UserEssentials/UserLog/Logger.php(90): SV\UserEssentials\UserLog\AbstractHandler->logChange(Object(SV\BookmarkEssentials\XF\Entity\Post), 'message', '😆 asdadasdad...', '😆 asdadasdad...', Object(SV\BookmarkEssentials\XF\Entity\User))
#9 src/addons/SV/UserEssentials/XF/Logger.php(76): SV\UserEssentials\UserLog\Logger->logChanges('post', Object(SV\BookmarkEssentials\XF\Entity\Post), true)
#10 src/addons/SV/UserEssentials/XF/Entity/Post.php(50): SV\UserEssentials\XF\Logger->logUserChanges('post', Object(SV\BookmarkEssentials\XF\Entity\Post))
#11 src/addons/SV/PostFriction/XF/Entity/Post.php(553): SV\UserEssentials\XF\Entity\Post->_postSave()
#12 src/XF/Mvc/Entity/Entity.php(1272): SV\PostFriction\XF\Entity\Post->_postSave()
#13 src/XF/Service/Post/Editor.php(189): XF\Mvc\Entity\Entity->save(true, false)
#14 src/XF/Service/ValidateAndSavableTrait.php(42): XF\Service\Post\Editor->_save()
#15 src/XF/Pub/Controller/Post.php(146): XF\Service\Post\Editor->save()
#16 src/addons/SV/AlertImprovements/XF/Pub/Controller/Post.php(19): XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#17 src/XF/Mvc/Dispatcher.php(352): SV\AlertImprovements\XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'Edit', Object(XF\Mvc\RouteMatch), Object(SV\AlertImprovements\XF\Pub\Controller\Post), NULL)
#19 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\AlertImprovements\XF\Pub\Controller\Post), NULL)
#20 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
#22 src/XF.php(524): XF\App->run()
#23 index.php(20): XF::runApp('XF\\Pub\\App')
#24 {main}


array(4) {
  ["url"] => string(18) "/posts/2314514/edit"
  ["referrer"] => string(78) "https://abc123xyzsampledomain.com/threads/test-thread-with-emoji-%F0%9F%98%86.128005/"
  ["_GET"] => array(1) {
    ["/posts/2314514/edit"] => string(0) ""
  }
  ["_POST"] => array(10) {
    ["_xfToken"] => string(8) "********"
    ["_xfInlineEdit"] => string(1) "1"
    ["prefix_id"] => string(1) "0"
    ["title"] => string(28) "Test Thread with Emoji 😆 "
    ["message_html"] => string(430) "<p><img class="smilie smilie--emoji fr-fic fr-dii" alt="😆" title="Grinning squinting face&nbsp; &nbsp; :laughing:" src="https://twemoji.maxcdn.com/2/72x72/1f606.png" data-shortname=":laughing:">&nbsp;asdadasdadadadadasdas<img class="smilie smilie--emoji fr-fic fr-dii" alt="🏄‍♂️" title="Man surfing    :man_surfing:" src="https://twemoji.maxcdn.com/2/72x72/1f3c4-200d-2642-fe0f.png" data-shortname=":man_surfing:"></p>"
    ["attachment_hash"] => string(32) "40c8df548d8204073f8ee818f018200c"
    ["attachment_hash_combined"] => string(86) "{"type":"post","context":{"post_id":2314514},"hash":"40c8df548d8204073f8ee818f018200c"}"
    ["_xfRequestUri"] => string(51) "/threads/test-thread-with-emoji-%F0%9F%98%86.128005/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

Thanks for taking a look at this one.
 
@ENF ensure you've set $config['fullUnicode'] = true; in config.php, and run try running php cmd.php xf:convert-utf8mb4 to ensure all tables have been migrated to utf8mb4.
 
  • Like
Reactions: ENF
@ENF ensure you've set $config['fullUnicode'] = true; in config.php, and run try running php cmd.php xf:convert-utf8mb4 to ensure all tables have been migrated to utf8mb4.
Interesting. config.php was set correctly already and that site had long since converted the tables and emoji's were in use elsewhere.

Is it possible that if your addon was installed after the fact (or a carry over from upgrade) that running php cmd.php xf:convert-utf8mb4 would be required again? The issue wasn't detected until someone had the bright idea to put one in a thread title, lol.

I did run php cmd.php xf:convert-utf8mb4 again and the issue I reported above appears to be have been resolved now, thank you.
The error made sense that it was a encoding issue, just thought the tables would have already been set for utf8mb4 earlier.

Thanks for the quick return on this one.
 
Is it possible that if your addon was installed after the fact (or a carry over from upgrade) that running php cmd.php xf:convert-utf8mb4 would be required again? The issue wasn't detected until someone had the bright idea to put one in a thread title, lol.
The orignal User Essentials for XF1 didn't have it's table names in the format that xf:convert-utf8mb4 checked, the XF2 upgrade did migrate the tables, but depending on ordering of operations the tables could be missed.

To make it even more confusing, depending on which tables are touched during various upgrades; some of them could have been updated but not others.
 
The orignal User Essentials for XF1 didn't have it's table names in the format that xf:convert-utf8mb4 checked, the XF2 upgrade did migrate the tables, but depending on ordering of operations the tables could be missed.

To make it even more confusing, depending on which tables are touched during various upgrades; some of them could have been updated but not others.
Ah, okay... that makes some sense. That's likely what had happened. It just never got found through testing. I'm 90% sure the XF1 version was there when it was moved to XF2. Thanks for the explanation and we appreciate your work 1000%. (y)
 
To make it even more confusing, depending on which tables are touched during various upgrades; some of them could have been updated but not others.
Just FYI, for future reference, when the conversion command was run again after your original post above, these were the tables that showed up on that list.
Code:
[1/11] xf_sv_convess_auto_response... Done
[2/11] xf_sv_convess_conversation_user... Done
[3/11] xf_sv_convess_group... Done
[4/11] xf_sv_convess_group_user... Done
[5/11] xf_sv_convess_label... Done
[6/11] xf_sv_convess_user_options... Done
[7/11] xf_sv_sticky_thread_order... Done
[8/11] xf_sv_thread_lock... Done
[9/11] xf_sv_unc... Done
[10/11] xf_sv_unc_cron... Done
[11/11] xf_sv_user_log... Done
Thinking back, I'm also pretty sure that the [addon] upgrades were done after the initial XF1 -> XF2 table conversion was completed. The xf:convert-utf8mb4 command was probably run one time and never again (until now).
 
Top Bottom