MDL-62619 privacy: Fix a missing alias in the blog provider class
authorDavid Mudrák <david@moodle.com>
Wed, 4 Jul 2018 07:46:53 +0000 (09:46 +0200)
committerDavid Mudrák <david@moodle.com>
Fri, 27 Jul 2018 08:14:43 +0000 (10:14 +0200)
The new implementation revealed another existing bug that did not expose
before due to coincidently same named table alias in the outer query.

blog/classes/privacy/provider.php

index 7fb7853..e3acab9 100644 (file)
@@ -135,7 +135,7 @@ class provider implements
         if ($DB->record_exists('blog_external', ['userid' => $userid])) {
             $sql = "
                 SELECT ctx.id
-                  FROM {context}
+                  FROM {context} ctx
                  WHERE ctx.contextlevel = :ctxlevel
                    AND ctx.instanceid = :ctxuserid";
             $params = [