FMCorz / moodle-block_xp

A gamification plugin for Moodle allowing students to gain experience points and level up.
https://levelup.plus/?ref=github
149 stars 41 forks source link

Purge log may delete more than it should #66

Closed FMCorz closed 7 years ago

FMCorz commented 7 years ago

According to this piece of code, it seems that the courseid is missing.

public function purge_log() {
    global $DB;
    $keeplogs = $this->get_config('keeplogs');
    if (!$keeplogs) {
        return;
    } else {
        // The cron is set to run only once a day, so no need to test the last time it was purged here.
        $DB->delete_records_select('block_xp_log', 'time < :time', array(
            'time' => time() - ($keeplogs * DAYSECS)
        ));
    }
}
FMCorz commented 7 years ago

Resolved in v3.0.