Fix for not being able to delete items

This commit is contained in:
Michael 2018-05-26 18:07:27 +00:00
parent e9dbf55400
commit bdbc51229a
12 changed files with 65 additions and 25 deletions

View file

@ -201,8 +201,16 @@ class Item extends BaseObject
// send the notification upstream/downstream
Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", "drop", intval($item['id']));
} elseif ($item['uid'] != 0) {
// When we delete just our local user copy of an item, we have to set an marker to hide it
$global_item = dba::selectFirst('item', ['id'], ['uri' => $item['uri'], 'uid' => 0, 'deleted' => false]);
if (DBM::is_result($global_item)) {
dba::update('user-item', ['hidden' => true], ['iid' => $global_item['id'], 'uid' => $item['uid']], true);
}
}
logger('Item with ID ' . $item_id . " has been deleted.", LOGGER_DEBUG);
return true;