From 66cef7531a182dcf122ddb2ea695628b4d083bd8 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 12 Jan 2015 16:36:10 -0800 Subject: don't wipe out the item body of a linked item to a photo when doing a normal delete and not forced --- include/items.php | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index e9e78acc5..dd9dbc7f9 100755 --- a/include/items.php +++ b/include/items.php @@ -4060,13 +4060,24 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL,$force = false) { case DROPITEM_NORMAL: default: - $r = q("UPDATE item SET item_restrict = ( item_restrict | %d ), body = '', title = '', - changed = '%s', edited = '%s' WHERE id = %d", - intval(($linked_item && ! $force) ? ITEM_HIDDEN : ITEM_DELETED), - dbesc(datetime_convert()), - dbesc(datetime_convert()), - intval($item['id']) - ); + if($linked_item && ! $force) { + $r = q("UPDATE item SET item_restrict = ( item_restrict | %d ), + changed = '%s', edited = '%s' WHERE id = %d", + intval(ITEM_HIDDEN), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + intval($item['id']) + ); + } + else { + $r = q("UPDATE item SET item_restrict = ( item_restrict | %d ), body = '', title = '', + changed = '%s', edited = '%s' WHERE id = %d", + intval(ITEM_DELETED), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + intval($item['id']) + ); + } break; } -- cgit v1.2.3