I am having an issue where badges on some of my courses, have suddenly duplicated and now there is over 1800 copies of the badge. Please help
We just got the same issue on one of our sites. In one course, there are 113 available badges but 2772 if we go to Manage badges.
There is no Sharing cart on this site.
Now, here's what we tested after checking the logs.
1- Go to a test course ans create a badge with criterion "activity completion". We chose feedback. So badge is awarded to whoever submits a feedback.
2- I submitted a feedback, just to be sure.
3- I deleted the feedback activity.
4- I went to de recycle bin and restored the activity.
Result: all the badges in the course (not only the one related to the feedback activity) were duplicated. I had 3 badges at the beginning and I end up with 6 badges.
I deteled the feedback and restored again. Surprise, I have 12 badges. So everything got duplicated again.
I'll keep you posted with more testing.
EDIT: First test is on Moodle 3.11.13. Was able to replicate on 4.1.3.
EDIT 2: Replicated on qa.moodledemo.net running 4.3 dev.
1- Add a badge to a course. No need to add criteria.
2- Add a resource or activity, delete it and restore from the recycle bin.
3- Go to Manage Badges and count.
There is no Sharing cart on this site.
Now, here's what we tested after checking the logs.
1- Go to a test course ans create a badge with criterion "activity completion". We chose feedback. So badge is awarded to whoever submits a feedback.
2- I submitted a feedback, just to be sure.
3- I deleted the feedback activity.
4- I went to de recycle bin and restored the activity.
Result: all the badges in the course (not only the one related to the feedback activity) were duplicated. I had 3 badges at the beginning and I end up with 6 badges.
I deteled the feedback and restored again. Surprise, I have 12 badges. So everything got duplicated again.
I'll keep you posted with more testing.
EDIT: First test is on Moodle 3.11.13. Was able to replicate on 4.1.3.
EDIT 2: Replicated on qa.moodledemo.net running 4.3 dev.
1- Add a badge to a course. No need to add criteria.
2- Add a resource or activity, delete it and restore from the recycle bin.
3- Go to Manage Badges and count.
Issue created last week: https://tracker.moodle.org/browse/MDL-78495
The same Issue on our Sites and we need fast a Quick Tip.
On one course over 128.000 Badges and i cannot open the badges control site.
On the mdl_badge Table are 29,165,825 entries.
How can i delete all the unnused badges ?
Only cleanup on mdl_badge ?
On one course over 128.000 Badges and i cannot open the badges control site.
On the mdl_badge Table are 29,165,825 entries.
How can i delete all the unnused badges ?
Only cleanup on mdl_badge ?
Can this works?
DELETE FROM mdl_badge mb WHERE mb.status = 0
DELETE FROM mdl_badge_criteria mbc
WHERE NOT EXISTS (SELECT NULL FROM mdl_badge mb WHERE mb.id = mbc.badgeid)
DELETE FROM mdl_badge_criteria_param mbcp
WHERE NOT EXISTS (SELECT NULL FROM mdl_badge_criteria mbc WHERE mbc.id = mbcp.critid)
We had a similar issue back in 2021. We ended up with over 17,000 badges in one course The team that manages our site installation narrowed this down to an issue with the Block "sharing_cart" and PHP version 7.2 or less. They updating our site to use PHP 7.3 and they also updated the Sharing Cart to the latest version and this solved the problem.
However they also had to go in somehow and delete all but the handful of badges we actually wanted. I didn't want to have to delete them manually, one-by-one. I assume they edited a database file on the server.
Hope this helps.
John
++++++++++++++++++++++++++++++++++++++++++++++++
Sharing Cart
Version 3.10, release 3 - 2021.06.26
The "master" branch is no longer compatible with Moodle 3.2 or earlier.
Moodle 3.2 => "MOODLE_32_STABLE" branch
Moodle 2.2 => "MOODLE_22_STABLE" branch
Moodle 1.9 => "MOODLE_19_STABLE" branch
Warning: PHP versions 7.2 and older are deprecated, and will cause problems, unrelated to the Sharing Cart, such as badges.
However they also had to go in somehow and delete all but the handful of badges we actually wanted. I didn't want to have to delete them manually, one-by-one. I assume they edited a database file on the server.
Hope this helps.
John
++++++++++++++++++++++++++++++++++++++++++++++++
Sharing Cart
Version 3.10, release 3 - 2021.06.26
The "master" branch is no longer compatible with Moodle 3.2 or earlier.
Moodle 3.2 => "MOODLE_32_STABLE" branch
Moodle 2.2 => "MOODLE_22_STABLE" branch
Moodle 1.9 => "MOODLE_19_STABLE" branch
Warning: PHP versions 7.2 and older are deprecated, and will cause problems, unrelated to the Sharing Cart, such as badges.