diff options
author | Friendika <info@friendika.com> | 2011-10-03 02:39:19 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-10-03 02:39:19 -0700 |
commit | 70911731313d58458e48a50e76c4b3b8a4d2c934 (patch) | |
tree | 09c9fcf50f09f9b8df2b8d4e897ad99e90c1aeab | |
parent | 60147d893cc367b56d23971c2483deeb91a19759 (diff) | |
download | volse-hubzilla-70911731313d58458e48a50e76c4b3b8a4d2c934.tar.gz volse-hubzilla-70911731313d58458e48a50e76c4b3b8a4d2c934.tar.bz2 volse-hubzilla-70911731313d58458e48a50e76c4b3b8a4d2c934.zip |
removing another potential way a post could have a zero parent.
-rw-r--r-- | mod/item.php | 5 |
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), |