From 6be5da67b1a0290da3938b87bebc71fd429f4414 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 8 Aug 2011 19:10:36 -0700 Subject: reparenting imported item was only partially reparenting. --- include/items.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 50d7bd68c..a378a632c 100644 --- a/include/items.php +++ b/include/items.php @@ -718,6 +718,13 @@ function item_store($arr,$force_parent = false) { if($r[0]['uri'] != $r[0]['parent-uri']) { $arr['thr-parent'] = $arr['parent-uri']; $arr['parent-uri'] = $r[0]['parent-uri']; + $z = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `parent-uri` = '%s' AND `uid` = %d LIMIT 1", + dbesc($r[0]['parent-uri']), + dbesc($r[0]['parent-uri']), + intval($arr['uid']) + ); + if($z && count($z)) + $r = $z; } $parent_id = $r[0]['id']; -- cgit v1.2.3