Merge pull request #4933 from annando/bugfix-distribute
Bugfix: The Distribition of public items failed with comments
This commit is contained in:
commit
9e700ba6ea
|
@ -863,11 +863,24 @@ class Item extends BaseObject
|
||||||
|
|
||||||
unset($item['id']);
|
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 (?, ?)",
|
$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];
|
$parent['owner-id'], CONTACT_IS_SHARING, CONTACT_IS_FRIEND];
|
||||||
$contacts = dba::select('contact', ['uid'], $condition);
|
$contacts = dba::select('contact', ['uid'], $condition);
|
||||||
while ($contact = dba::fetch($contacts)) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue