diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2022-09-01 08:24:35 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2022-09-01 08:24:35 +0000 |
| commit | bdf2f4da7b0c090f6fae71f4b1c19bfea3d6b5e0 (patch) | |
| tree | 1e236643db600d9d370e28b4fd095554785c5182 /lib/classes/Context.php | |
| parent | 1361b2929303878139a42329511accc1ccf180e8 (diff) | |
use SORM instead plain sql, closes #1491
Closes #1491
Merge request studip/studip!930
Diffstat (limited to 'lib/classes/Context.php')
| -rw-r--r-- | lib/classes/Context.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/classes/Context.php b/lib/classes/Context.php index 09b3a1b..33e1097 100644 --- a/lib/classes/Context.php +++ b/lib/classes/Context.php @@ -242,14 +242,11 @@ class Context && !match_route('dispatch.php/course/members/additional_input') && !match_route('dispatch.php/course/change_view/*')) { - $query = "SELECT 1 - FROM datafields_entries - WHERE range_id = ? AND sec_range_id = ? - LIMIT 1"; - $statement = DBManager::get()->prepare($query); - $statement->execute([$GLOBALS['user']->id, $course['Seminar_id']]); - - if (!$statement->rowCount()) { + $count = DatafieldEntryModel::countBySql( + 'range_id = ? AND sec_range_id = ?', + [$GLOBALS['user']->id, $course['Seminar_id']] + ); + if (!$count) { header('Location: ' . URLHelper::getURL('dispatch.php/course/members/additional_input')); page_close(); die; |
