From 04ef8180233b088cc4e3a4d0e28ee394375e1c31 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 19 Apr 2018 15:17:43 +0800 Subject: [PATCH] MDL-62025 mod_choice: add missing join on modules table --- mod/choice/classes/privacy/provider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/choice/classes/privacy/provider.php b/mod/choice/classes/privacy/provider.php index 9bb3ede074a..8d094fc9fb7 100644 --- a/mod/choice/classes/privacy/provider.php +++ b/mod/choice/classes/privacy/provider.php @@ -115,6 +115,7 @@ class provider implements ca.timemodified FROM {context} c INNER JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel + INNER JOIN {modules} m ON m.id = cm.module AND m.name = :modname INNER JOIN {choice} ch ON ch.id = cm.instance INNER JOIN {choice_options} co ON co.choiceid = ch.id INNER JOIN {choice_answers} ca ON ca.optionid = co.id AND ca.choiceid = ch.id @@ -122,7 +123,7 @@ class provider implements AND ca.userid = :userid ORDER BY cm.id"; - $params = ['contextlevel' => CONTEXT_MODULE, 'userid' => $user->id] + $contextparams; + $params = ['modname' => 'choice', 'contextlevel' => CONTEXT_MODULE, 'userid' => $user->id] + $contextparams; // Reference to the choice activity seen in the last iteration of the loop. By comparing this with the current record, and // because we know the results are ordered, we know when we've moved to the answers for a new choice activity and therefore