From 70911731313d58458e48a50e76c4b3b8a4d2c934 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 3 Oct 2011 02:39:19 -0700 Subject: removing another potential way a post could have a zero parent. --- mod/item.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/item.php b/mod/item.php index e5d4eea82..b8c0683aa 100644 --- a/mod/item.php +++ b/mod/item.php @@ -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), -- cgit v1.2.3