From da3658c80d7c9a2f681aece4372398e11679e7e4 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 26 Apr 2018 19:47:12 +0000 Subject: [PATCH] =?UTF-8?q?Bugfix:=20The=20Distribition=20of=20public=20it?= =?UTF-8?q?ems=20failed=20with=20comments#=20Bitte=20geben=20Sie=20eine=20?= =?UTF-8?q?Commit-Beschreibung=20f=C3=BCr=20Ihre=20=C3=84nderungen=20ein.?= =?UTF-8?q?=20Zeilen,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Model/Item.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index c16281ae3e..14d2f8009f 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -863,11 +863,24 @@ class Item extends BaseObject unset($item['id']); + $users = []; + $condition = ["`nurl` IN (SELECT `nurl` FROM `contact` WHERE `id` = ?) AND `uid` != 0 AND NOT `blocked` AND NOT `readonly` AND `rel` IN (?, ?)", $parent['owner-id'], CONTACT_IS_SHARING, CONTACT_IS_FRIEND]; $contacts = dba::select('contact', ['uid'], $condition); while ($contact = dba::fetch($contacts)) { - self::storeForUser($itemid, $item, $contact['uid']); + $users[$contact['uid']] = $contact['uid']; + } + + if ($item['uri'] != $item['parent-uri']) { + $parents = dba::select('item', ['uid'], ["`uri` = ? AND `uid` != 0", $item['parent-uri']]); + while ($parent = dba::fetch($parents)) { + $users[$parent['uid']] = $parent['uid']; + } + } + + foreach ($users as $uid) { + self::storeForUser($itemid, $item, $uid); } }