Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed embargoed time settings is not kept in the form when re-editing…

… by error
  • Loading branch information...
commit cc86131d785040d9f8a8a3375e70c3bc01478139 1 parent 46dce76
patrickslee authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 mod/forum/post.php
View
16 mod/forum/post.php
@@ -250,6 +250,22 @@
if (! $discussion = get_record("forum_discussions", "id", $post->discussion)) {
error("This post is not part of a discussion! ($post->discussion)");
}
+ } else {
+ $discussion = new stdClass();
+ $newstopic = false;
+ if ($forum->type == 'news' && !$post->parent) {
+ $newstopic = true;
+ }
+ if ($newstopic && empty($post->timestartdisabled)) {
+ $discussion->timestart = make_timestamp($post->timestartyear, $post->timestartmonth, $post->timestartday);
+ } else {
+ $discussion->timestart = 0;
+ }
+ if ($newstopic && empty($post->timeenddisabled)) {
+ $discussion->timeend = make_timestamp($post->timeendyear, $post->timeendmonth, $post->timeendday);
+ } else {
+ $discussion->timeend = 0;
+ }
}
} else if (!empty($forum)) { // User is starting a new discussion in a forum
Please sign in to comment.
Something went wrong with that request. Please try again.