aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-10-03 02:39:19 -0700
committerFriendika <info@friendika.com>2011-10-03 02:39:19 -0700
commit70911731313d58458e48a50e76c4b3b8a4d2c934 (patch)
tree09c9fcf50f09f9b8df2b8d4e897ad99e90c1aeab /mod
parent60147d893cc367b56d23971c2483deeb91a19759 (diff)
downloadvolse-hubzilla-70911731313d58458e48a50e76c4b3b8a4d2c934.tar.gz
volse-hubzilla-70911731313d58458e48a50e76c4b3b8a4d2c934.tar.bz2
volse-hubzilla-70911731313d58458e48a50e76c4b3b8a4d2c934.zip
removing another potential way a post could have a zero parent.
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php5
1 files changed, 5 insertions, 0 deletions
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),