diff options
| author | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2021-11-17 14:22:11 +0100 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2021-11-17 14:22:11 +0100 |
| commit | cb45e11a1407a9b3a98dc43c1094ba13dfcb3fd2 (patch) | |
| tree | 8b9c6850a12985fef5d3d52d09fceb929fda5efd /app/controllers/course/basicdata.php | |
| parent | bb349cfdd1ed0ef322c434752486b3a281be8ecd (diff) | |
fix SORM usage in https://develop.studip.de/trac/changeset/60202, fixes #346
Diffstat (limited to 'app/controllers/course/basicdata.php')
| -rw-r--r-- | app/controllers/course/basicdata.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/course/basicdata.php b/app/controllers/course/basicdata.php index 1df3a20..bc20ed5 100644 --- a/app/controllers/course/basicdata.php +++ b/app/controllers/course/basicdata.php @@ -621,7 +621,7 @@ class Course_BasicdataController extends AuthenticatedController if ($deputies_enabled) { // Check whether chosen person is set as deputy // -> delete deputy entry. - $deputy = Deputy::find([$dozent, $course_id]); + $deputy = Deputy::find([$course_id, $dozent]); if ($deputy) { $deputy->delete(); } @@ -702,12 +702,12 @@ class Course_BasicdataController extends AuthenticatedController PageLayout::postError(_('Sie dürfen sich nicht selbst aus der Veranstaltung austragen.')); } else { $sem = Seminar::getInstance($course_id); - $deputy = Deputy::find([$deputy_id, $course_id]); + $deputy = Deputy::find([$course_id, $deputy_id]); if ($deputy && $deputy->delete()) { // Remove user from subcourses as well. - if($sem->children) { + if (count($sem->children)) { $children_ids = $sem->children->pluck('seminar_id'); - Deputy::deleteBySQL('user_id = ? AND range_id IN (?)', [$children_ids]); + Deputy::deleteBySQL('user_id = ? AND range_id IN (?)', [$deputy_id, $children_ids]); } PageLayout::postSuccess(sprintf( @@ -850,8 +850,8 @@ class Course_BasicdataController extends AuthenticatedController $dozent->status = 'dozent'; $dozent->comment = ''; if ($dozent->store()) { - $deputy = Deputy::find([$GLOBALS['user']->id, $course_id]); - if($deputy) { + $deputy = Deputy::find([$course_id, $GLOBALS['user']->id]); + if ($deputy) { $deputy->delete(); } PageLayout::postSuccess(sprintf(_('Sie wurden als %s eingetragen.'), |
