From c15b933c69fd1e7888362b423466064ba73d1b45 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Fri, 11 Nov 2011 14:16:17 +0100 Subject: [PATCH] MDL-29108 Orphaned areas are excluded from search results If for any reason the referenced context does not exist any more, the forms defined in relevant areas are considered removed (even if their records still exist in the database). --- grade/grading/pick.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grade/grading/pick.php b/grade/grading/pick.php index 5b0175b494f..fd4d6ef81f1 100644 --- a/grade/grading/pick.php +++ b/grade/grading/pick.php @@ -147,7 +147,8 @@ if ($searchdata = $searchform->get_data()) { $sql = "SELECT DISTINCT gd.id, gd.areaid, gd.name, gd.description, gd.descriptionformat, gd.timecreated, gd.usercreated, gd.timemodified, gd.usermodified FROM {grading_definitions} gd - JOIN {grading_areas} ga ON (gd.areaid = ga.id)"; + JOIN {grading_areas} ga ON (gd.areaid = ga.id) + JOIN {context} cx ON (ga.contextid = cx.id)"; // join method-specific tables from the plugin scope $sql .= $targetcontrollerclass::sql_search_from_tables('gd.id'); -- 2.43.0