Skip to content
Snippets Groups Projects
Commit a8e260a8 authored by David Siegfried's avatar David Siegfried
Browse files

fixes #3156

Closes #3156

Merge request studip/studip!2132
parent 49caeeab
No related branches found
No related tags found
No related merge requests found
...@@ -196,12 +196,12 @@ class MyCoursesController extends AuthenticatedController ...@@ -196,12 +196,12 @@ class MyCoursesController extends AuthenticatedController
$add_query = "LEFT JOIN seminar_user as su1 ON (su1.seminar_id=seminare.Seminar_id AND su1.status='dozent')"; $add_query = "LEFT JOIN seminar_user as su1 ON (su1.seminar_id=seminare.Seminar_id AND su1.status='dozent')";
} elseif ($group_field === 'mvv') { } elseif ($group_field === 'mvv') {
$add_fields = ', mm.`modul_id` AS mvv'; $add_fields = ', mm.`modul_id` AS mvv';
$add_query = "LEFT JOIN `mvv_lvgruppe_seminar` AS mls ON (mls.`seminar_id` = seminare.`Seminar_id`) $add_query = "LEFT JOIN `mvv_lvgruppe_seminar` AS mls ON (mls.`seminar_id` = seminare.`Seminar_id`)
LEFT JOIN `mvv_lvgruppe` AS ml ON (mls.`lvgruppe_id` = ml.`lvgruppe_id`) LEFT JOIN `mvv_lvgruppe` AS ml ON (mls.`lvgruppe_id` = ml.`lvgruppe_id`)
LEFT JOIN `mvv_lvgruppe_modulteil` AS mlm on(mls.`lvgruppe_id` = mlm.`lvgruppe_id`) LEFT JOIN `mvv_lvgruppe_modulteil` AS mlm on(mls.`lvgruppe_id` = mlm.`lvgruppe_id`)
LEFT JOIN `mvv_modulteil` AS mmt ON (mlm.`modulteil_id` = mmt.`modulteil_id`) LEFT JOIN `mvv_modulteil` AS mmt ON (mlm.`modulteil_id` = mmt.`modulteil_id`)
LEFT JOIN `mvv_modul` AS mm ON (mmt.`modul_id` = mm.`modul_id`)"; LEFT JOIN `mvv_modul` AS mm ON (mmt.`modul_id` = mm.`modul_id`)";
} }
$dbv = DbView::getView('sem_tree'); $dbv = DbView::getView('sem_tree');
...@@ -401,7 +401,10 @@ class MyCoursesController extends AuthenticatedController ...@@ -401,7 +401,10 @@ class MyCoursesController extends AuthenticatedController
// Ensure last teacher cannot leave course // Ensure last teacher cannot leave course
$course = Course::find($course_id); $course = Course::find($course_id);
if ($course->members->findOneBy('user_id', $GLOBALS['user']->id)->status === 'dozent' $teacher = $course->members->findOneBy('user_id', User::findCurrent()->id);
if (
$teacher
&& $teacher->status === 'dozent'
&& count($course->getMembersWithStatus('dozent')) === 1 && count($course->getMembersWithStatus('dozent')) === 1
) { ) {
PageLayout::postError(sprintf( PageLayout::postError(sprintf(
......
...@@ -161,7 +161,8 @@ class messaging ...@@ -161,7 +161,8 @@ class messaging
$msg = Message::find($message_id); $msg = Message::find($message_id);
$receiver = User::find($rec_user_id); $receiver = User::find($rec_user_id);
$to = $receiver->Email; $to = $receiver->Email;
$reply_to = '';
$snd_fullname = '';
// do not try to send mails to users without a mail address // do not try to send mails to users without a mail address
if (!$to) { if (!$to) {
return; return;
......
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