Fix: Ensure that the value is set.

This commit is contained in:
Michael 2018-07-07 19:39:00 +00:00
parent 4d35e228c4
commit afa194200b

View file

@ -752,7 +752,7 @@ class Item extends BaseObject
if (!empty($item['plink'])) {
$content_fields['plink'] = $item['plink'];
}
if ((self::activityToIndex($item['verb']) >= 0) || !empty($item['iaid'])) {
if (!empty($item['iaid']) || (!empty($content_fields['verb']) && (self::activityToIndex($content_fields['verb']) >= 0))) {
self::updateActivity($content_fields, ['uri' => $item['uri']]);
if (empty($item['iaid'])) {
@ -768,6 +768,12 @@ class Item extends BaseObject
dba::delete('item-content', ['id' => $item['icid']]);
}
}
} elseif (!empty($item['icid'])) {
dba::update('item', ['icid' => null], ['id' => $item['id']]);
if (!dba::exists('item', ['icid' => $item['icid']])) {
dba::delete('item-content', ['id' => $item['icid']]);
}
}
} else {
self::updateContent($content_fields, ['uri' => $item['uri']]);