From: Michael Date: Thu, 26 Apr 2018 19:47:12 +0000 (+0000) Subject: Bugfix: The Distribition of public items failed with comments# Bitte geben Sie eine... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=da3658c80d7c9a2f681aece4372398e11679e7e4;p=friendica.git Bugfix: The Distribition of public items failed with comments# Bitte geben Sie eine Commit-Beschreibung für Ihre Änderungen ein. Zeilen, --- 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); } }