diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-01 23:08:47 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-01 23:08:47 +0000 |
commit | 64df5b36acedd476aa12f9abc26cf494e8b774ca (patch) | |
tree | 507437d91cf1f3dd694fb96facb103cc4ad9e4b1 /mod | |
parent | 425b9b8c8b2d01b8d1de1a782dd466e2a4ff1569 (diff) | |
download | elgg-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')
-rw-r--r-- | mod/blog/actions/blog/save.php | 16 |
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'"; |