From f6fc182ea21e009298220fc276ba428e8c36ace0 Mon Sep 17 00:00:00 2001 From: ferishili Date: Wed, 21 Aug 2024 11:00:41 +0200 Subject: [PATCH] fix code checker issues --- classes/external.php | 2 +- classes/local/upload_helper.php | 7 ++++--- lang/en/block_opencast.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/classes/external.php b/classes/external.php index 4d283418..ec900b23 100644 --- a/classes/external.php +++ b/classes/external.php @@ -458,7 +458,7 @@ public static function unarchive_uploadjob(int $contextid, int $ocinstanceid, in 'id' => $params['uploadjobid'], 'ocinstanceid' => $params['ocinstanceid'], 'courseid' => $course->id, - 'status' => upload_helper::STATUS_ARCHIVED_FAILED_UPLOAD + 'status' => upload_helper::STATUS_ARCHIVED_FAILED_UPLOAD, ]; $uploadjob = $DB->get_record('block_opencast_uploadjob', $params); diff --git a/classes/local/upload_helper.php b/classes/local/upload_helper.php index 50651855..1a38719c 100644 --- a/classes/local/upload_helper.php +++ b/classes/local/upload_helper.php @@ -461,7 +461,7 @@ protected function upload_failed($job, $errormessage) { 'errormessage' => $errormessage, 'countfailed' => $job->countfailed, 'ocinstanceid' => $job->ocinstanceid, - 'archived' => $isarchived + 'archived' => $isarchived, ], ] ); @@ -715,7 +715,8 @@ public function cron() { $ocinstances = settings_api::get_ocinstances(); foreach ($ocinstances as $ocinstance) { // Get all waiting jobs. - $sql = "SELECT * FROM {block_opencast_uploadjob} WHERE status < ? AND status <> ? AND ocinstanceid = ? ORDER BY timemodified ASC "; + $sql = "SELECT * FROM {block_opencast_uploadjob}" . + " WHERE status < ? AND status <> ? AND ocinstanceid = ? ORDER BY timemodified ASC "; $limituploadjobs = get_config('block_opencast', 'limituploadjobs_' . $ocinstance->id); @@ -726,7 +727,7 @@ public function cron() { $params = [ self::STATUS_TRANSFERRED, self::STATUS_ARCHIVED_FAILED_UPLOAD, - $ocinstance->id + $ocinstance->id, ]; $jobs = $DB->get_records_sql($sql, $params, 0, $limituploadjobs); diff --git a/lang/en/block_opencast.php b/lang/en/block_opencast.php index 4e3ba007..4e6232cf 100644 --- a/lang/en/block_opencast.php +++ b/lang/en/block_opencast.php @@ -581,8 +581,8 @@ $string['notificationeventstatusteachers'] = 'Notify all course teachers about the event process status'; $string['notificationeventstatusteachers_desc'] = 'With this option, apart from the uploader of the video, all the teachers of the course where the video is uploaded from get notified about the Opencast processing status.'; $string['notifications_settings_header'] = 'Notifications'; -$string['notificationuploadarchived_subj'] = 'Opencast Archived Event Upload Notification'; $string['notificationuploadarchived_body'] = 'The upload job for the video titled "{$a->title}" in the course "{$a->coursefullname}" (ID: {$a->courseid}) has been archived due to reaching the limit of failed attempts. Your action is now required to either delete the job or manually put the job back into the queue. Please contact your system administrator to ensure the upload problem is resolved.'; +$string['notificationuploadarchived_subj'] = 'Opencast Archived Event Upload Notification'; $string['notificationuploaduqeuestatus_body'] = 'Processing of this video: {$a->videotitle} in the course: {$a->coursefullname} (ID: {$a->courseid}) is queued, but has not yet started. The video is currently waiting behind {$a->waitingnum} other video(s) in the processing queue.'; $string['notificationuploaduqeuestatus_subj'] = 'Opencast Event Upload Notification'; $string['notpublished'] = 'Not published';