Skip to content

Commit

Permalink
Fix bug when no submissions notifiers are selected (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
agwells authored Oct 28, 2024
1 parent f67154c commit 48bd4fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions classes/controllers/submissions_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ protected function create_submission() {
if ($submission->finalised) {
if (!$submission->get_coursework()->has_deadline()) {

$userids = explode(',', $submission->get_coursework()->get_submission_notification_users());
$useridcommaseparatedlist = $submission->get_coursework()->get_submission_notification_users();

if (!empty($userids)) {
if (!empty($useridcommaseparatedlist)) {
$userids = explode(',', $useridcommaseparatedlist);
foreach ($userids as $u) {
$notifyuser = $DB->get_record('user', ['id' => trim($u)]);

Expand Down
5 changes: 3 additions & 2 deletions classes/forms/student_submission_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ public function handle() {

if (!$submission->get_coursework()->has_deadline()) {

$userids = explode(',', $submission->get_coursework()->get_submission_notification_users());
$useridcommaseparatedlist = $submission->get_coursework()->get_submission_notification_users();

if (!empty($userids)) {
if (!empty($useridcommaseparatedlist)) {
$userids = explode(',', $useridcommaseparatedlist);
foreach ($userids as $u) {
$notifyuser = $DB->get_record('user', ['id' => trim($u)]);
$mailer = new mailer($coursework);
Expand Down

0 comments on commit 48bd4fe

Please sign in to comment.