From e8ae121fd7a2818273e5fed2fda770faeaf77686 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Tue, 22 Apr 2014 11:51:40 +0800 Subject: [PATCH] MDL-45172 block_completionstatus: added a check for an empty string before appending --- blocks/completionstatus/block_completionstatus.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blocks/completionstatus/block_completionstatus.php b/blocks/completionstatus/block_completionstatus.php index e92f1bcb322..c68a1f69c82 100644 --- a/blocks/completionstatus/block_completionstatus.php +++ b/blocks/completionstatus/block_completionstatus.php @@ -235,7 +235,6 @@ class block_completionstatus extends block_base { // Display link to detailed view. $details = new moodle_url('/blocks/completionstatus/details.php', array('course' => $course->id)); - $this->content->footer = html_writer::empty_tag('br'); $this->content->footer = html_writer::link($details, get_string('moredetails', 'completion')); } else { // If user is not enrolled, show error. @@ -244,6 +243,9 @@ class block_completionstatus extends block_base { if (has_capability('report/completion:view', $context)) { $report = new moodle_url('/report/completion/index.php', array('course' => $course->id)); + if (empty($this->content->footer)) { + $this->content->footer = ''; + } $this->content->footer .= html_writer::empty_tag('br'); $this->content->footer .= html_writer::link($report, get_string('viewcoursereport', 'completion')); }