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

Validation for Course Module id in OU Blog Maintenance Cron Task #144

Open
vithushau opened this issue Aug 21, 2024 · 0 comments
Open

Validation for Course Module id in OU Blog Maintenance Cron Task #144

vithushau opened this issue Aug 21, 2024 · 0 comments

Comments

@vithushau
Copy link

Hi

Moodle Version: 4.1

Description:
We encountered an error during the execution of the OU Blog maintenance cron task. The task fails due to an 'Invalid course module ID,' and it appears that no validation is added to check if the course module id is valid before the task runs.

Error Details:

     Execute scheduled task: OU blog maintenance jobs (mod_oublog\task\cron_task)
 ... started 11:06:38. Current memory use 3.0 MB.
 Debugging increased temporarily due to faildelay of 86400
 ... used 5 dbqueries
 ... used 0.11644983291626 seconds
 Scheduled task failed: OU blog maintenance jobs (mod_oublog\task\cron_task),Invalid course module ID
 Debug info:
 SELECT id,course FROM {course_modules} WHERE id IS NULL
 [array (
 )]
 11:06:39 Backtrace:
 * line 1630 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
 * line 7442 of /lib/accesslib.php: call to moodle_database->get_record()
 * line 54 of /mod/oublog/classes/task/cron_task.php: call to context_module::instance()
 * line 309 of /lib/cronlib.php: call to mod_oublog\task\cron_task->execute()
 * line 167 of /admin/cli/scheduled_task.php: call to cron_run_inner_scheduled_task() 

Also we noticed another area that needed the coursemodule validation in lib.php

https://github.com/moodleou/moodle-mod_oublog/blob/master/lib.php#L176

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

No branches or pull requests

1 participant