mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-63892 mod_forum: Fix last post details in forum view
This commit is contained in:
parent
81e8a74a7b
commit
ee95b9c319
1 changed files with 2 additions and 5 deletions
|
@ -3925,7 +3925,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring
|
|||
}
|
||||
|
||||
echo '<td class="lastpost">';
|
||||
$usedate = (empty($post->created)) ? $post->timemodified : $post->created;
|
||||
$usedate = (empty($post->timemodified)) ? $post->created : $post->timemodified;
|
||||
$parenturl = '';
|
||||
$usermodified = new stdClass();
|
||||
$usermodified->id = $post->usermodified;
|
||||
|
@ -4558,10 +4558,6 @@ function forum_update_post($newpost, $mform, $unused = null) {
|
|||
}
|
||||
$post->modified = time();
|
||||
|
||||
// Last post modified tracking.
|
||||
$discussion->timemodified = $post->modified;
|
||||
$discussion->usermodified = $post->userid;
|
||||
|
||||
if (!$post->parent) { // Post is a discussion starter - update discussion title and times too
|
||||
$discussion->name = $post->subject;
|
||||
$discussion->timestart = $post->timestart;
|
||||
|
@ -4574,6 +4570,7 @@ function forum_update_post($newpost, $mform, $unused = null) {
|
|||
$post->message = file_save_draft_area_files($newpost->itemid, $context->id, 'mod_forum', 'post', $post->id,
|
||||
mod_forum_post_form::editor_options($context, $post->id), $post->message);
|
||||
$DB->update_record('forum_posts', $post);
|
||||
// Note: Discussion modified time/user are intentionally not updated, to enable them to track the latest new post.
|
||||
$DB->update_record('forum_discussions', $discussion);
|
||||
|
||||
forum_add_attachment($post, $forum, $cm, $mform);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue