Skip to content
Snippets Groups Projects
Commit 9beb0e6d authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Elmar Ludwig
Browse files

fix sql query, fixes #2285

Closes #2285

Merge request studip/studip!1511
parent 5655e10f
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
...@@ -280,26 +280,18 @@ class EvaluationQuestionDB extends EvaluationObjectDB ...@@ -280,26 +280,18 @@ class EvaluationQuestionDB extends EvaluationObjectDB
{ {
$db = DBManager::get(); $db = DBManager::get();
if (EvaluationObjectDB::getGlobalPerm() == "root") { if (EvaluationObjectDB::getGlobalPerm() === 'root') {
$sql = $sql = "SELECT evalquestion_id
"SELECT" . FROM evalquestion
" evalquestion_id " . WHERE parent_id = '0'
"FROM" . ORDER BY text";
" evalquestion " .
"WHERE" .
" parent_id = '0' ORDER BY text";
return $db->fetchFirst($sql); return $db->fetchFirst($sql);
} else { } else {
$sql = $sql = "SELECT evalquestion_id
"SELECT" . FROM evalquestion
" evalquestion_id " . WHERE parent_id = ?
"FROM" . OR parent_id = '0'
" evalquestion " . ORDER BY text";
"WHERE" .
" parent_id = '" . $userID . "' " .
"OR " .
" parent_id = '0' ORDER BY text";
$sql .= " ";
return $db->fetchFirst($sql, [$userID]); return $db->fetchFirst($sql, [$userID]);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment