Skip to content

Commit

Permalink
edit a discussion subject fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaroWalter committed Sep 7, 2023
1 parent 8ffc2f0 commit ac61679
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/post/post_control.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,11 @@ private function execute_edit($form, $errordestination) {
// Check if the user has the capability to edit his post.
$this->check_user_can_edit_post();

// If the post that is being edited is the parent post, the subject can be edited too.
if ($this->prepost->parentid == 0) {
$this->prepost->subject = $form->subject;
}

// Update the post.
if (!$this->info->discussion->moodleoverflow_edit_post_from_discussion($this->prepost)) {
throw new \moodle_exception('couldnotupdate', 'moodleoverflow', $errordestination);
Expand Down

0 comments on commit ac61679

Please sign in to comment.