]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixes saving a new blog post - was trying to do an update to without a guid
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 1 Mar 2011 23:08:47 +0000 (23:08 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 1 Mar 2011 23:08:47 +0000 (23:08 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8547 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/actions/blog/save.php

index ecf6c9b51ffd3cfb19b76126084f04c97190899e..704f0fc6d3001b92e507af25a543899223d71d51 100644 (file)
@@ -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'";