Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… by error
  • Loading branch information...
commit cc86131d785040d9f8a8a3375e70c3bc01478139 1 parent 46dce76
authored

Showing 1 changed file with 16 additions and 0 deletions. Show diff stats Hide diff stats

  1. 16  mod/forum/post.php
16  mod/forum/post.php
@@ -250,6 +250,22 @@
250 250
             if (! $discussion = get_record("forum_discussions", "id", $post->discussion)) {
251 251
                 error("This post is not part of a discussion! ($post->discussion)");
252 252
             }
  253
+        } else {
  254
+            $discussion = new stdClass();
  255
+            $newstopic = false;
  256
+            if ($forum->type == 'news' && !$post->parent) {
  257
+                $newstopic = true;
  258
+            }
  259
+            if ($newstopic && empty($post->timestartdisabled)) {
  260
+                $discussion->timestart = make_timestamp($post->timestartyear, $post->timestartmonth, $post->timestartday);
  261
+            } else {
  262
+                $discussion->timestart = 0;
  263
+            }
  264
+            if ($newstopic && empty($post->timeenddisabled)) {
  265
+                $discussion->timeend = make_timestamp($post->timeendyear, $post->timeendmonth, $post->timeendday);
  266
+            } else {
  267
+                $discussion->timeend = 0;
  268
+            }
253 269
         }
254 270
 
255 271
     } else if (!empty($forum)) {      // User is starting a new discussion in a forum

0 notes on commit cc86131

Please sign in to comment.
Something went wrong with that request. Please try again.