From 56e9b6d67da9eee225a9551b4cbd989632888122 Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 15 May 2019 09:50:46 +0800 Subject: [PATCH 1/2] MDL-65603 mod_forum: Recall inline private reply --- mod/forum/post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/forum/post.php b/mod/forum/post.php index 8efe6f567e8..f8da7328f16 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -36,6 +36,7 @@ $confirm = optional_param('confirm', 0, PARAM_INT); $groupid = optional_param('groupid', null, PARAM_INT); $subject = optional_param('subject', '', PARAM_TEXT); $prefilledpost = optional_param('post', '', PARAM_TEXT); +$prefilledprivatereply = optional_param('privatereply', false, PARAM_BOOL); $PAGE->set_url('/mod/forum/post.php', array( 'reply' => $reply, @@ -260,6 +261,7 @@ if (!empty($forum)) { $post->userid = $USER->id; $post->parentpostauthor = $parent->userid; $post->message = $prefilledpost; + $post->isprivatereply = $prefilledprivatereply; $canreplyprivately = $capabilitymanager->can_reply_privately_to_post($USER, $parententity); $post->groupid = ($discussion->groupid == -1) ? 0 : $discussion->groupid; @@ -743,7 +745,8 @@ $mformpost->set_data( 'userid' => $post->userid, 'parent' => $post->parent, 'discussion' => $post->discussion, - 'course' => $course->id + 'course' => $course->id, + 'isprivatereply' => $post->isprivatereply ) + $pageparams + From d7ddc44fbd4461cf1da929ff85120a5f4ce7738d Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 15 May 2019 16:50:49 +0800 Subject: [PATCH 2/2] MDL-65603 mod_forum: Add check for property existence --- mod/forum/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/forum/post.php b/mod/forum/post.php index f8da7328f16..94a13fbf7d2 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -746,7 +746,7 @@ $mformpost->set_data( 'parent' => $post->parent, 'discussion' => $post->discussion, 'course' => $course->id, - 'isprivatereply' => $post->isprivatereply + 'isprivatereply' => $post->isprivatereply ?? false ) + $pageparams +