Skip to content

Commit

Permalink
Fix rewritten queries that did not select the vf table when removing …
Browse files Browse the repository at this point in the history
…subquery statements.
  • Loading branch information
srobotta committed Oct 22, 2024
1 parent 5cc9315 commit a0f8937
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ?",
Expand All @@ -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);
Expand Down

0 comments on commit a0f8937

Please sign in to comment.