[OzzModz] Badges

[OzzModz] Badges 2.3.5 Patch Level 2

No permission to download
  • XF\Db\DeadlockException: MySQL query error [1213]: Deadlock found when trying to get lock; try restarting transaction
  • src/XF/Db/AbstractStatement.php:230
Code:
INSERT  INTO `xf_job` (`execute_class`, `execute_data`, `unique_key`, `manual_execute`, `trigger_date`) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE
            execute_class = VALUES(execute_class),
            execute_data = VALUES(execute_data),
            manual_execute = VALUES(manual_execute),
            trigger_date = VALUES(trigger_date),
            last_run_date = NULL
        
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL query err...', 1213, '40001')
#1 src/XF/Db/Mysqli/Statement.php(79): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1213, '40001')
#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/Job/Manager.php(527): XF\Db\AbstractAdapter->insert('xf_job', Array, false, '
            execute_cla...')
#5 src/XF/Job/Manager.php(469): XF\Job\Manager->_enqueue('badgeUpdate6049...', 'OzzModz\\Badges:...', Array, false, 1670589689)
#6 src/addons/OzzModz/Badges/Listener.php(213): XF\Job\Manager->enqueueUnique('badgeUpdate6049...', 'OzzModz\\Badges:...', Array, false)
#7 src/XF/Extension.php(69): OzzModz\Badges\Listener::appPubStartEnd(Object(XF\Pub\App))
#8 src/XF/App.php(2990): XF\Extension->fire('app_pub_start_e...', Array, NULL)
#9 src/XF/Pub/App.php(202): XF\App->fire('app_pub_start_e...', Array)
#10 src/XF/App.php(2479): XF\Pub\App->start(true)
#11 src/XF.php(524): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}
 
Hi - I've created a custom user field that results in a user banner. Unfortunately, this add-on is adding the badges before this custom user banner as you can see here:

View attachment 277986Anyone have any suggestions on what I need to change to get the badge below the custom user banner?

Thanks.
What plugin do you use for “top poster of the month”?
 
Done that but they are still showing
You must perform a user badge cache rebuild if you want to apply changes to already awarded badges.

1670766434243.png


Can’t remove badges after the update even if we have the permission.
They are probably issued through the user's criteria. This has long been hard blocked for withdrawal, as they will automatically be issued again. In the next version, we will make this possible, just with the note that this will be issued again.

Anyone have any suggestions on what I need to change to get the badge below the custom user banner?

Thanks.
This can only be changed by adding custom template modification.

Check the "message_macros" template modifications by custom banner addon: you need to find out which code fragment it captures.


Can't overwrite old files, do you know why?
It's a system administration issue. Make sure the files are owned by the correct user on the system and have the correct permissions.

  • XF\Db\DeadlockException: MySQL query error [1213]: Deadlock found when trying to get lock; try restarting transaction
  • src/XF/Db/AbstractStatement.php:230
How often do you see it? Did you have any other active badge rebuild jobs at this moment?
 
We've noticed that the badge user promotion criteria does not appear to work as expected. We set ownership of 4 badges by unique ID in a comma separated list to trigger a user promotion, and those promotions never occur with the user group promotions cron job run.

Just to be sure, this is the way we're supposed to be setting those criteria, correct?

1670860940352.png

EDIT: It might not be specific to this addon. We also noted a standard user group promotion based on default criteria also works unreliably. Trying to pinpoint what the precise issue might be but it is proving to be a challenge as there's no discernible difference between two users that should get a promotion, and only one of them actually gets it...
 
Last edited:
Avaraging between 1 hour to 20 minutes.
Check if you have too resource intensive user criteria on badges.
Some criteria may perform very slow database queries.

We've noticed that the badge user promotion criteria does not appear to work as expected. We set ownership of 4 badges by unique ID in a comma separated list to trigger a user promotion, and those promotions never occur with the user group promotions cron job run.

Just to be sure, this is the way we're supposed to be setting those criteria, correct?
Sent you the latest version in PM for testing. This criteria has been optimized and changed to a drop down list.
 
Am I missing something simple with stacking?

I'm just testing things out - so have 3 badges setup in a stack, given when you post X articles

1671097386445.png

This shows up properly as a stack under badges in the users profile:

1671097413420.png

But the postbit and profile popup show the first one - not the head of the stack (5 guides)

1671097524165.png

Tried rebuilding cache but no dice...
 
Hi @Ozzy47,

The addon works great, I'm in the process of getting rid of the one from AddonFlare. Can we please have separate options to limit the number of badges shown in messages and user profiles?

Thanks in advance.
 
Last edited:
Hi so I set up a new badge to award a trophy. It awarded a lot more than 1 as you can see here:
Screenshot 2022-12-16 at 3.50.46 PM.webp Any idea why 5 trophies are showing up instead of just the one?
 
I did at the beginning but then turned it off once I saw this. Then ran the cron but didn’t remove. Should I delete and start again?
 
I did at the beginning but then turned it off once I saw this. Then ran the cron but didn’t remove. Should I delete and start again?
If you rebuild badges I think it may fix it? I do not know if they will be removed or not if you do that.
 
Am I missing something simple with stacking?

I'm just testing things out - so have 3 badges setup in a stack, given when you post X articles

View attachment 278321

This shows up properly as a stack under badges in the users profile:

View attachment 278322

But the postbit and profile popup show the first one - not the head of the stack (5 guides)

View attachment 278323

Tried rebuilding cache but no dice...
Having this same issue; you can feature the badge, and it fixes it, otherwise it will show the first one you got.
 
Hi @Ozzy47,

The addon works great, I'm in the process of getting rid of the one from AddonFlare. Can we please have separate options to limit the number of badges shown in messages and user profiles?

Thanks in advance.

I'm about to do the same.... Can you run the two addons side by side without too much noise? I'm trying to recreate the badges and criteria (as this addon lacks an importer for the Addon flare awards addon).
 
Top Bottom