diff --git a/mod/data/lib.php b/mod/data/lib.php index bcdcf618379ff..2d8b07df813af 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -497,7 +497,6 @@ protected function get_data_content(int $recordid) { * @return bool|string */ function display_browse_field($recordid, $template) { - global $DB; $content = $this->get_data_content($recordid); if (!$content || !isset($content->content)) { return ''; @@ -508,7 +507,8 @@ function display_browse_field($recordid, $template) { $options->filter = false; } $options->para = false; - $str = format_text($content->content, $content->content1, $options); + $format = !empty($content->content1) ? $content->content1 : null; + $str = format_text($content->content, $format, $options); return $str; }