From 4e9c2677e5a05d5112e2bb06437bc9bf2e39afcb Mon Sep 17 00:00:00 2001 From: Anthony Ales Date: Thu, 19 Apr 2018 14:20:08 -0600 Subject: [PATCH] MDL-48338 forum: Missing #unread in discussion post url When a user user selects the unread messages link from the forum discussion page, the link does not include '#unread' in the url. This patch appends '#unread' to the url by changing the appropriate value in the reference link assigned to $out within the function forum_cm_info_view() of the 'lib.php'file. A similar change is on the forum index. --- mod/forum/index.php | 4 ++-- mod/forum/lib.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/forum/index.php b/mod/forum/index.php index 5c7f49e2232..10a97f59962 100644 --- a/mod/forum/index.php +++ b/mod/forum/index.php @@ -240,7 +240,7 @@ if ($generalforums) { if (isset($untracked[$forum->id])) { $unreadlink = '-'; } else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) { - $unreadlink = ''.$unread.''; + $unreadlink = ''.$unread.''; $icon = $OUTPUT->pix_icon('t/markasread', $strmarkallread); $unreadlink .= '' . $icon . ''; @@ -371,7 +371,7 @@ if ($course->id != SITEID) { // Only real courses have learning forums if (isset($untracked[$forum->id])) { $unreadlink = '-'; } else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) { - $unreadlink = ''.$unread.''; + $unreadlink = ''.$unread.''; $icon = $OUTPUT->pix_icon('t/markasread', $strmarkallread); $unreadlink .= '' . $icon . ''; diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 633be19178b..27698f3165f 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -7497,7 +7497,7 @@ function forum_cm_info_view(cm_info $cm) { if (forum_tp_can_track_forums()) { if ($unread = forum_tp_count_forum_unread_posts($cm, $cm->get_course())) { - $out = ' '; + $out = ' '; if ($unread == 1) { $out .= get_string('unreadpostsone', 'forum'); } else {