Skip to content

Commit

Permalink
fix: set_deadline
Browse files Browse the repository at this point in the history
  • Loading branch information
RiedleroD committed Dec 17, 2024
1 parent e79fd6b commit b2ae002
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lbplanner/services/plan/set_deadline.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ public static function set_deadline(int $moduleid, int $deadlinestart, int $dead
throw new \moodle_exception('Access denied');
}

// If a deadline already exists.
if (!$DB->record_exists(plan_helper::DEADLINES_TABLE, ['moduleid' => $moduleid, 'planid' => $planid])) {
$deadline = $DB->get_record(plan_helper::DEADLINES_TABLE, ['moduleid' => $moduleid, 'planid' => $planid]);

if ($deadline !== false) {
// Update the existing deadline.
$deadline = $DB->get_record(plan_helper::DEADLINES_TABLE, ['moduleid' => $moduleid, 'planid' => $planid]);

$deadline->deadlinestart = $deadlinestart;
$deadline->deadlineend = $deadlineend;
Expand Down

0 comments on commit b2ae002

Please sign in to comment.