From 9a8944c52d04028f40c46279f343a052bb7a778b Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 9 Oct 2018 08:21:38 +0800 Subject: [PATCH] MDL-63401 tool_dataprivacy: Simplify where processing --- admin/tool/dataprivacy/classes/expired_contexts_manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/tool/dataprivacy/classes/expired_contexts_manager.php b/admin/tool/dataprivacy/classes/expired_contexts_manager.php index cfdd378e109..be8d731c46c 100644 --- a/admin/tool/dataprivacy/classes/expired_contexts_manager.php +++ b/admin/tool/dataprivacy/classes/expired_contexts_manager.php @@ -157,7 +157,7 @@ class expired_contexts_manager { $where = ''; if (!empty($contextpath)) { - $where = "AND (ctx.path = :pathmatchexact OR ctx.path LIKE :pathmatchchildren)"; + $where = "WHERE (ctx.path = :pathmatchexact OR ctx.path LIKE :pathmatchchildren)"; $params['pathmatchexact'] = $contextpath; $params['pathmatchchildren'] = "{$contextpath}/%"; } @@ -177,7 +177,7 @@ class expired_contexts_manager { ON dpctx.contextid = ctx.id LEFT JOIN {tool_dataprivacy_ctxexpired} expiredctx ON ctx.id = expiredctx.contextid - WHERE 1 = 1 {$where} + {$where} ORDER BY ctx.path DESC"; return self::get_nested_expiry_info_from_sql($sql, $params);