Skip to content

If no programs defined, all calendar events are deleted by \enrol_programs\task\cron #11

Open
@julesfm

Description

@julesfm

If there are no programs defined, the SQL at line 179 of enrol/programs/classes/local/calendar.php fetches all calendar events, not just those with a component=='enrol_programs' as both "LEFT JOIN"s just produce null values. I think the "AND e.component=..." in the first "LEFT JOIN" isn't doing what you think it is.
As a result, the following code then deletes every event.
This is from the moodle version 4 stable branch of your code.

This is run at 1 minute past every hour as a scheduled task, so you don't have long to create a program before all your calendar events are wiped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions