Function to remove an achievement entirely

Created on 27 November 2012, about 12 years ago
Updated 15 July 2024, 5 months ago

Perhaps I'm missing something in the API, but there doesn't seem to be a method to completely delete an achievement and existing unlocks.

Scenario;
Say we have a course node type and related to this course node type we have several achievements. Now in the future after several users have achieved some of the achievements against a specific course, the course is now outdated or no longer available. The course is then deleted from the system. To avoid leaving cruft in the database I would want to also remove said achivement unlocks.

The best I have come up with is to iterate over the corresponding achievements calling achievements_locked() for each user that has achieved said achievement. This is very time consuming and generally needs to be handled via batch processing. It would be great to have an equivalent of achievements_user_delete(), but for achievement ids.

Is there any interest in this functionality?

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jgraham

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024