[OzzModz] Badges

[OzzModz] Badges 2.3.5 Patch Level 2

No permission to download
Noticed a (very) minor issue while playing around with this on our test forum. The addon doesn't currently set a admin_permission.ozzmodz_badges phrase.
 
@Ozzy47 any possibility of getting support for DB Credits added, using the events functionality of that add-on? If needed I'll finance the feature as it's something I have been needing for a while from any award/badge system.
 
Received the following error when trying to manually grant a badge on our test forum.

Code:
Error: Call to a member function getPushTemplateName() on null in src/XF/Service/Alert/Pusher.php at line 53
XF\Service\Alert\Pusher->getNotificationBody() in src/XF/Service/PusherTrait.php at line 187
XF\Service\Alert\Pusher->push() in src/XF/Repository/UserAlert.php at line 163
XF\Repository\UserAlert->insertAlert() in src/XF/Repository/UserAlert.php at line 101
XF\Repository\UserAlert->alertFromUser() in src/addons/OzzModz/Badges/Repository/UserBadge.php at line 35
OzzModz\Badges\Repository\UserBadge->awardWithBadge() in src/addons/OzzModz/Badges/XF/Pub/Controller/Member.php at line 106
OzzModz\Badges\XF\Pub\Controller\Member->actionAwardBadge() in src/XF/Mvc/Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 261
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2344
XF\App->run() in src/XF.php at line 512
XF::runApp() in index.php at line 20

EDIT: Interestingly, it does appear to still grant the badge, despite the error.
 
Last edited:
While attempting to add a badge on someone's profile, I got this error. Unlike @Bulbagarden it did not apply the badge.


Code:
ErrorException: [E_WARNING] foreach() argument must be of type array|object, null given in src/addons/OzzModz/Badges/XF/Entity/User.php at line 123

    XF::handlePhpError() in src/addons/OzzModz/Badges/XF/Entity/User.php at line 123
    OzzModz\Badges\XF\Entity\User->rebuildBadgeCache() in src/addons/OzzModz/Badges/Entity/UserBadge.php at line 35
    OzzModz\Badges\Entity\UserBadge->_postSave() in src/XF/Mvc/Entity/Entity.php at line 1266
    XF\Mvc\Entity\Entity->save() in src/addons/OzzModz/Badges/Repository/UserBadge.php at line 31
    OzzModz\Badges\Repository\UserBadge->awardWithBadge() in src/addons/OzzModz/Badges/XF/Pub/Controller/Member.php at line 106
    OzzModz\Badges\XF\Pub\Controller\Member->actionAwardBadge() in src/XF/Mvc/Dispatcher.php at line 350
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
    XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2344
    XF\App->run() in src/XF.php at line 512
    XF::runApp() in index.php at line 20

I ran the importer as per the instructions with the VersoBit badges addon disabled, had this error, attempted a total uninstall of both VersoBit and this addon then reinstalled and I still have the same error. Any assistance would be appreciated.
 
#3 Repetitive badges
This one gets a thumbs up from me. We have site supporters who contribute every year... would be good for that user to amass a trophy for each year they have supported... so yes, you could get someone with 10 trophys, however one would signify each year of support...
Now, how to implement that.... i havent a clue! :D
 
  • Like
Reactions: TFW
I'm getting this with the importer (Patch 2):

Code:
Server error log
ErrorException: [E_WARNING] Undefined variable $saved src/addons/OzzModz/Badges/Import/Importer/VersoBitBadges.php:311
Generated by: ... 24. Jul 2021 at 20:28
Stack trace
#0 src/addons/OzzModz/Badges/Import/Importer/VersoBitBadges.php(311): XF::handlePhpError(2, '[E_WARNING] Und...', '/home/...', 311)
#1 src/XF/Import/Runner.php(242): OzzModz\Badges\Import\Importer\VersoBitBadges->stepUsers(Object(XF\Import\StepState), Array, 8)
#2 src/XF/Import/Runner.php(59): XF\Import\Runner->runStep('users', Object(XF\Import\StepState), 8)
#3 src/XF/Admin/Controller/Import.php(234): XF\Import\Runner->run()
#4 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Import->actionRun(Object(XF\Mvc\ParameterBag))
#5 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Import', 'Run', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Import), NULL)
#6 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Import), NULL)
#7 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#8 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#9 src/XF.php(512): XF\App->run()
#10 admin.php(13): XF::runApp('XF\\Admin\\App')
#11 {main}


And this:

Code:
Server error log
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '10-705' for key 'PRIMARY' src/XF/Db/AbstractStatement.php:228
Generated by: ... 24. Jul 2021 at 20:28
Stack trace
INSERT  INTO `xf_ozzmodz_badges_user_badge` (`badge_id`, `user_id`, `award_date`, `reason`, `featured`) 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(1510): XF\Db\AbstractAdapter->insert('xf_ozzmodz_badg...', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1242): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/OzzModz/Badges/Import/Importer/VersoBitBadges.php(304): XF\Mvc\Entity\Entity->save()
#7 src/XF/Import/Runner.php(242): OzzModz\Badges\Import\Importer\VersoBitBadges->stepUsers(Object(XF\Import\StepState), Array, 8)
#8 src/XF/Import/Runner.php(59): XF\Import\Runner->runStep('users', Object(XF\Import\StepState), 8)
#9 src/XF/Admin/Controller/Import.php(234): XF\Import\Runner->run()
#10 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Import->actionRun(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Import', 'Run', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Import), NULL)
#12 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Import), NULL)
#13 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#15 src/XF.php(512): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}
 
@BassMan, There shouldn't be any duplicates for awarded badges since the VersoBit's add-on this columns is also unique.
Have you run this importer before?
 
In the previous version I had the same error. Now importer seems to be working, but something is still wrong.

It imports:
+ badges names
+ badges criteria


It doesn't import:
- badges categories (I mean they are imported but with wrong names - all of categories got some random badges names)
- badges icons
- awarded users (only some were imported, but most of them were not)

I was trying to reinstall it again, but still got the same issue.
 
Seems to be an issue with the badge sort order. In our testing, we've got the sort order set to disabled (so meant to show featured badges only), but for some reason it's ignoring that setting. For example, on one user with 4 badges (2 set as featured by the user, 2 not), it's displaying only the 2 oldest badges (one of which isn't actually set as featured), rather than the intended 2 featured badges.

can I award bagdes to usergroups? badge 1 to registered, badge 2 to moderators etc...

Yes, that's what a lot of us use this addon for.
 
1. is there a way to hide some badges from the badge list in help? like some badges are part of discipline to the users. lol
2. how to add font awesome that i paid for like the pro ones?
3. there a bug...

Screenshot_392.png

Screenshot_393.png

suppose to be directed to like https://www.dallascowboysuniverse.com/help/ozzmodz_badges/ for example.

4. Where is the user setting which to display the badge? I could not find it.

5. I would like where users cant turn off a badge like displine ones that users cant remove the badge. Lol
 
Last edited:
Nice to see the badge awards back to life!

Feature request: I have awards that are given to the members who spend 5, 10 years on the forum. Can we get it so that if you get the award for 10 years, the one for 5 years disappears?
 
- awarded users (only some were imported, but most of them were not)
Unfortunately I cannot reproduce this in my local environment.
Can someone send me the dump of import log table? (import_log_versobitbadges_*)
 
Top Bottom