1
0
Fork 0

More "item" traces removed

This commit is contained in:
Michael 2021-02-14 09:43:27 +00:00
commit 07c07ec499
15 changed files with 325 additions and 463 deletions

View file

@ -77,7 +77,7 @@ class Item
'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink',
'wall', 'private', 'starred', 'origin', 'title', 'body', 'language',
'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object',
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'item_id',
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network',
'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'owner-network',
'causer-id', 'causer-link', 'causer-name', 'causer-avatar', 'causer-contact-type',
@ -959,6 +959,10 @@ class Item
$item['deny_gid']
);
if (!empty($item['extid'])) {
$item['external-id'] = ItemURI::getIdByURI($item['extid']);
}
if ($item['verb'] == Activity::ANNOUNCE) {
self::setOwnerforResharedItem($item);
}

View file

@ -94,6 +94,10 @@ class Post
}
}
if (array_key_exists('extid', $row) && is_null($row['extid'])) {
$row['extid'] = '';
}
return $row;
}
@ -526,8 +530,8 @@ class Post
}
}
if (!empty($update_fields)) {
$rows = DBA::selectToArray('post-view', ['id'], $condition, []);
$ids = array_column($rows, 'id');
$rows = DBA::selectToArray('post-view', ['item-id'], $condition, []);
$ids = array_column($rows, 'item-id');
if (!DBA::update('item', $update_fields, ['id' => $ids])) {
DBA::rollback();
Logger::notice('Updating item failed', ['fields' => $update_fields, 'condition' => $condition]);