Skip to content

Commit 55141fc

Browse files
authored
read paella json data properly from mod, (#57)
fixes #56
1 parent 3ade3f8 commit 55141fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

classes/text_filter.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ protected function render_player(int $ocinstanceid, string $episodeid, bool $sho
212212
int $playerid, $width = null, $height = null) {
213213
global $OUTPUT, $PAGE, $COURSE;
214214

215-
$data = paella_transform::get_paella_data_json($ocinstanceid, $episodeid);
215+
list($data, $errormessage) = paella_transform::get_paella_data_json($ocinstanceid, $episodeid);
216216

217217
if (!$data) {
218218
return null;
@@ -253,9 +253,10 @@ protected function render_player(int $ocinstanceid, string $episodeid, bool $sho
253253
$renderer = $PAGE->get_renderer('filter_opencast');
254254
return $renderer->render_player($mustachedata);
255255
} else {
256+
$notificationmessage = !empty($errormessage) ? $errormessage : get_string('erroremptystreamsources', 'mod_opencast');
256257
return $OUTPUT->render(new \core\output\notification(
257-
get_string('erroremptystreamsources', 'mod_opencast'),
258-
\core\output\notification::NOTIFY_ERROR
258+
$notificationmessage,
259+
\core\output\notification::NOTIFY_ERROR
259260
));
260261
}
261262
}

0 commit comments

Comments
 (0)