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

Error on delete_orphaned_questions schedulded task execution #438

Open
cmichenaud opened this issue Jan 31, 2023 · 1 comment
Open

Error on delete_orphaned_questions schedulded task execution #438

cmichenaud opened this issue Jan 31, 2023 · 1 comment

Comments

@cmichenaud
Copy link

cmichenaud commented Jan 31, 2023

Hi,

On my Moodle 4.1.1 server, I noticed errors in the schedulded tasks log report about studentquiz plugin (V5.1.0 - 2022122200) and more precisely on delete_orphaned_questions task.
Maybe is there typing mistake in the sql query ?
Here is the debug message :

Unknown column 'sq.state' in 'where clause'
SELECT q.*, sqq.id as studentquizquestionid
                       FROM mdl_studentquiz_question sqq
                       JOIN mdl_question_references qr ON qr.itemid = sqq.id
                            AND qr.component = 'mod_studentquiz'
                            AND qr.questionarea = 'studentquiz_question'
                       JOIN mdl_question_bank_entries qbe ON qr.questionbankentryid = qbe.id
                       JOIN mdl_question_versions qv ON qv.questionbankentryid = qr.questionbankentryid
                       JOIN mdl_question q ON qv.questionid = q.id
                      WHERE sq.state = 0 AND ? - q.timemodified > 0
                   ORDER BY q.questionid ASC

And the backtrace :

Backtrace:
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 1278 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
* line 64 of /mod/studentquiz/classes/task/delete_orphaned_questions.php: call to mysqli_native_moodle_database->get_records_sql()
* line 259 of /lib/cronlib.php: call to mod_studentquiz\task\delete_orphaned_questions->execute()
* line 120 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
* line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
* line 178 of /admin/cli/cron.php: call to cron_run()

Thanks in advance for your feedback.

@vuvanhieu143
Copy link
Contributor

Thank you for your report @cmichenaud ,I will take a look at this issue

@vuvanhieu143 vuvanhieu143 mentioned this issue Feb 7, 2023
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

2 participants