From a0f89378a5f9ccafdacffce15a0cd668a4e50247 Mon Sep 17 00:00:00 2001 From: Stephan Robotta Date: Tue, 22 Oct 2024 20:10:52 +0200 Subject: [PATCH] Fix rewritten queries that did not select the vf table when removing subquery statements. --- classes/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/api.php b/classes/api.php index 630999e..5a1e287 100644 --- a/classes/api.php +++ b/classes/api.php @@ -120,7 +120,7 @@ public static function get_instance_by_itemid($itemid) { return $instances[$id]; } $instances[$id] = $DB->get_record_sql(" - SELECT * FROM {{$vftable} vf + SELECT vf.* FROM {{$vftable} vf INNER JOIN {{$cattable}} cat ON cat.instanceid = vf.id INNER JOIN {{$crittable}} crit ON crit.categoryid = cat.id WHERE crit.id = ?", @@ -144,7 +144,7 @@ public static function get_instance_by_categoryid($categoryid) { return $instances[$id]; } $instances[$id] = $DB->get_record_sql(" - SELECT * FROM {{$vftable}} vf + SELECT vf.* FROM {{$vftable}} vf INNER JOIN {{$cattable}} cat ON cat.instanceid = vf.id WHERE cat.id = ?", [$id], IGNORE_MISSING);