Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
julesfm opened this issue Jan 15, 2024 · 0 comments · May be fixed by #12
Open

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

julesfm opened this issue Jan 15, 2024 · 0 comments · May be fixed by #12

Comments

@julesfm
Copy link

julesfm commented Jan 15, 2024

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.

matthewhilton added a commit to catalyst/moodle-enrol_programs that referenced this issue Apr 15, 2024
@matthewhilton matthewhilton linked a pull request Apr 15, 2024 that will close this issue
matthewhilton added a commit to catalyst/moodle-enrol_programs that referenced this issue Apr 15, 2024
Peterburnett added a commit to catalyst/moodle-enrol_programs that referenced this issue May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant