From 396a1e6535fa3a5cbde5e3b044fa5618d6b6d972 Mon Sep 17 00:00:00 2001 From: NicoDucou Date: Thu, 14 Sep 2023 11:58:58 +0200 Subject: [PATCH] Course Progress: fix error when exporting progress when no thematic where set -refs BT#21016 --- main/course_progress/thematic_controller.php | 4 ++++ main/inc/lib/thematic.lib.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/main/course_progress/thematic_controller.php b/main/course_progress/thematic_controller.php index 4a2cd3befe..2f8414791c 100755 --- a/main/course_progress/thematic_controller.php +++ b/main/course_progress/thematic_controller.php @@ -210,6 +210,10 @@ class ThematicController $pdfOrientation = api_get_configuration_value('thematic_pdf_orientation'); $list = $thematic->get_thematic_list(); + if ($list === false) { + header('Location: '.api_get_self().'?'.api_get_cidreq()); + exit; + } $item = []; $listFinish = []; foreach ($list as $theme) { diff --git a/main/inc/lib/thematic.lib.php b/main/inc/lib/thematic.lib.php index 2249c819f4..c1776b609a 100755 --- a/main/inc/lib/thematic.lib.php +++ b/main/inc/lib/thematic.lib.php @@ -310,6 +310,8 @@ class Thematic $data[$row['id']] = $row; } } + } else { + return false; } return $data;