User Mentions Improvements by Xon

User Mentions Improvements by Xon 2.9.0

No permission to download
I'm getting some deadlocks related with that add-on in these days sometimes. even i'm using the CLI Job Runner add-on of you (may it related with cron times ? cron works every 5 min and time=240 parameter, should i increase them for prevent deadlocks? )

@Xon


Code:
XF\Db\DeadlockException: MySQL query error [1213]: Deadlock found when trying to get lock; try restarting transaction src/XF/Db/AbstractStatement.php:217
Tarafından: Bilinmeyen hesap 9 Eyl 2019 - 18:49
Stack Trace
-- XFDB=noForceAllWrite
            INSERT INTO xf_sv_user_activity 
            (content_type, content_id, `blob`, `timestamp`) 
            VALUES 
              (?,?,?,?),(?,?,?,?),(?,?,?,?)
             ON DUPLICATE KEY UPDATE `timestamp` = values(`timestamp`)
 
I'm getting mention and quote emails and from the thread itself when following a forum.

And when tagging the user group '@Super moderators' the member '@Super' is mentioned instead.
 
After you install and enable permissions, should you just be able to mention the usergroup by calling @Usergroup Name? If the usergroup is not popping up when you start typing, should that be a hint that it's not working?
 
I'm getting mention and quote emails and from the thread itself when following a forum.
This is expected; as those are generating alerts.

The "Send quote emails only on unreplied threads" option doesn't look to be doing anything oops.

And when tagging the user group '@Super moderators' the member '@Super' is mentioned instead.
Known design issue with how XF selects the user to tag; A workaround is to block users from having a username which is a subset of an existing user group name;
 
Code:
    public function renderTagUserGroupHtml($userGroupId, $css, $link, $content)
    {
        return $this->renderer->wrapHtml(
            "<a href='{$link}' class='{$css}' data-xf-click='overlay' data-usergroup-id='{$userGroupId}' data-groupname='{$content}' >",
            $content,
            '</a>');
    }
This makes customization painful. It would be great to move this HTML chunk into template

And another suggestion. Currently only one CSS class ("ug) using for the alerts template and in the posts (BBCodes). I think that would be more correct to use different classes and define them in CSS template.
 
After you install and enable permissions, should you just be able to mention the usergroup by calling @Usergroup Name? If the usergroup is not popping up when you start typing, should that be a hint that it's not working?
Still wondering on this - I haven't been able to tag usergroups. I typed in the full usergroup and it's not popping up.
 
Not sure if this is intended or a minor bug?

The Avatar image (small): field appears to get a Linux timestamp added (presumably as a cache buster) - however on editing (and re-editing) they seem to be stacking up:

/styles/default/sv/mentionimprovements/group_48.png?c=1569018947?c=1569019779?c=1569019897

Should there just be one of them?
 
Not sure if this is intended or a minor bug?

The Avatar image (small): field appears to get a Linux timestamp added (presumably as a cache buster) - however on editing (and re-editing) they seem to be stacking up:

/styles/default/sv/mentionimprovements/group_48.png?c=1569018947?c=1569019779?c=1569019897

Should there just be one of them?
Same here.

Every usergroup edit and save process add that version tags to png file. If you edit the usergroup 10 times, plugin add the version value for 10 times :)

@Xon
 
We have been receiving some of the errors below after upgrading. They seem to be triggered by this add-on.

Code:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '1-74904' for key 'PRIMARY' src/XF/Db/AbstractStatement.php:217
Generated by: healer Oct 22, 2019 at 14:49
Stack trace
INSERT  INTO `xf_user_group_promotion_log` (`promotion_id`, `user_id`, `promotion_date`, `promotion_state`) VALUES (?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('xf_user_group_p...', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Entity/UserGroupPromotion.php(44): XF\Mvc\Entity\Entity->save()
#7 src/XF/Repository/UserGroupPromotion.php(116): XF\Entity\UserGroupPromotion->promote(Object(SV\UserMentionsImprovements\XF\Entity\User))
#8 src/XF/Pub/App.php(236): XF\Repository\UserGroupPromotion->updatePromotionsForUser(Object(SV\UserMentionsImprovements\XF\Entity\User))
#9 src/XF/Pub/App.php(189): XF\Pub\App->updateUserCaches()
#10 src/XF/App.php(2174): XF\Pub\App->start(true)
#11 src/XF.php(390): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}
Request state
array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
That is unrelated to this add-on (it just extends the user entity).

Run the "rebuild user promotions" task under rebuild tools to fix this up.
 
Yes, that is what the "enable user mention" permission is for. Set it to deny and it'll block a user or usergroup from using the mention system
 
Update - unless I'm missing something, this doesn't seem to be working. I've set 'enable user mentions' to 'no' for the default Registered usergroup, but a test user can still use the feature. Can't set it to 'never' because I want to enable it for secondary usergroups.

Another update: denied that permission for the registered usergroup in node permissions too - made no difference. Analyzing permissions for that user in that forum, 'enable user mentions' is denied, but it still works for them.

But I think I must be missing something, because I also can't find any options on the front end for a user to enable emails for quotes or mentions. Where should I look for those?
 
Last edited:
Top Bottom