From: Michael Date: Fri, 29 Jun 2018 06:51:48 +0000 (+0000) Subject: Delete item content for older item records X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a82cf2ae29806bcd38cf9607f1be6ff61b0f722d;p=friendica.git Delete item content for older item records --- diff --git a/src/Model/Item.php b/src/Model/Item.php index 8a5264a7bc..55e824895c 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -750,8 +750,12 @@ class Item extends BaseObject self::deleteTagsFromItem($item); // Set the item to "deleted" - dba::update('item', ['deleted' => true, 'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow()], - ['id' => $item['id']]); + // This erasing of item content is superfluous for items with a matching item-content. + // But for the next time we will still have old content in the item table. + $item_fields = ['deleted' => true, 'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow(), + 'body' => '', 'title' => '', 'content-warning' => '', 'rendered-hash' => '', 'rendered-html' => '', + 'object' => '', 'target' => '']; + dba::update('item', $item_fields, ['id' => $item['id']]); Term::insertFromTagFieldByItemId($item['id']); Term::insertFromFileFieldByItemId($item['id']);