From c293c07a5e7050aa48deec5fd102ccb062333ca4 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Tue, 1 Jun 2004 09:47:28 +0000 Subject: [PATCH] Make sure course list block is never empty. --- blocks/course_list/block_course_list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php index 7dfc134624..ec2c56726c 100644 --- a/blocks/course_list/block_course_list.php +++ b/blocks/course_list/block_course_list.php @@ -71,7 +71,9 @@ class CourseBlock_course_list extends MoodleBlock { } $this->title = get_string('mycourses'); $this->content->footer = "wwwroot/course/index.php\">".get_string("fulllistofcourses")."..."; - return $this->content; + if ($this->content->items) { // make sure we don't return an empty list + return $this->content; + } } } -- 2.39.5