From 55141fc09f887b2b6de8815f74d764531ed8c826 Mon Sep 17 00:00:00 2001 From: FarbodZamani <53179227+ferishili@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:24:50 +0100 Subject: [PATCH] read paella json data properly from mod, (#57) fixes #56 --- classes/text_filter.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/text_filter.php b/classes/text_filter.php index 08b7c26..26e4908 100644 --- a/classes/text_filter.php +++ b/classes/text_filter.php @@ -212,7 +212,7 @@ protected function render_player(int $ocinstanceid, string $episodeid, bool $sho int $playerid, $width = null, $height = null) { global $OUTPUT, $PAGE, $COURSE; - $data = paella_transform::get_paella_data_json($ocinstanceid, $episodeid); + list($data, $errormessage) = paella_transform::get_paella_data_json($ocinstanceid, $episodeid); if (!$data) { return null; @@ -253,9 +253,10 @@ protected function render_player(int $ocinstanceid, string $episodeid, bool $sho $renderer = $PAGE->get_renderer('filter_opencast'); return $renderer->render_player($mustachedata); } else { + $notificationmessage = !empty($errormessage) ? $errormessage : get_string('erroremptystreamsources', 'mod_opencast'); return $OUTPUT->render(new \core\output\notification( - get_string('erroremptystreamsources', 'mod_opencast'), - \core\output\notification::NOTIFY_ERROR + $notificationmessage, + \core\output\notification::NOTIFY_ERROR )); } }