]> git.mxchange.org Git - friendica.git/commitdiff
removing another potential way a post could have a zero parent.
authorFriendika <info@friendika.com>
Mon, 3 Oct 2011 09:39:19 +0000 (02:39 -0700)
committerFriendika <info@friendika.com>
Mon, 3 Oct 2011 09:39:19 +0000 (02:39 -0700)
mod/item.php

index e5d4eea8208ba4a68f5dfc0057d5d8246df571b5..b8c0683aaca90144b5844d27374584109bf161e0 100644 (file)
@@ -779,6 +779,11 @@ function item_post(&$a) {
                        }
                }
 
+               // fallback so that parent always gets set to non-zero.
+
+               if(! $parent)
+                       $parent = $post_id;
+
                $r = q("UPDATE `item` SET `parent` = %d, `parent-uri` = '%s', `plink` = '%s', `changed` = '%s', `last-child` = 1, `visible` = 1
                        WHERE `id` = %d LIMIT 1",
                        intval($parent),