FMCorz/moodle-block_xp

Purge log may delete more than it should

Closed this issue · 1 comments

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)
        ));
    }
}

Resolved in v3.0.