aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/actions
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-01 23:08:47 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-01 23:08:47 +0000
commit64df5b36acedd476aa12f9abc26cf494e8b774ca (patch)
tree507437d91cf1f3dd694fb96facb103cc4ad9e4b1 /mod/blog/actions
parent425b9b8c8b2d01b8d1de1a782dd466e2a4ff1569 (diff)
downloadelgg-64df5b36acedd476aa12f9abc26cf494e8b774ca.tar.gz
elgg-64df5b36acedd476aa12f9abc26cf494e8b774ca.tar.bz2
fixes saving a new blog post - was trying to do an update to without a guid
git-svn-id: http://code.elgg.org/elgg/trunk@8547 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog/actions')
-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'";