aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/blog/actions/blog/save.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php
index ecf6c9b51..704f0fc6d 100644
--- a/mod/blog/actions/blog/save.php
+++ b/mod/blog/actions/blog/save.php
@@ -157,13 +157,15 @@ if (!$error) {
$date = $blog->publish_date;
- $q = "UPDATE {$db_prefix}entities SET time_created = '$date'
- WHERE guid = $guid";
- update_data($q);
-
- $q = "UPDATE {$db_prefix}river SET posted = '$date'
- WHERE object_guid = $guid AND action_type = 'create'";
- update_data($q);
+ if ($guid) {
+ $q = "UPDATE {$db_prefix}entities SET time_created = '$date'
+ WHERE guid = $guid";
+ update_data($q);
+
+ $q = "UPDATE {$db_prefix}river SET posted = '$date'
+ WHERE object_guid = $guid AND action_type = 'create'";
+ update_data($q);
+ }
} elseif ($old_status == 'published' && $status == 'draft') {
$q = "DELETE FROM {$db_prefix}river
WHERE object_guid = $blog->guid AND action_type = 'create'";