diff options
author | friendica <info@friendica.com> | 2015-01-12 16:36:10 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-01-12 16:36:10 -0800 |
commit | 66cef7531a182dcf122ddb2ea695628b4d083bd8 (patch) | |
tree | f19734bdc07cf8e7a72363acc4015c37c2a9029f | |
parent | cdc52ba88418f4289f8712ade232e429242f82e7 (diff) | |
download | volse-hubzilla-66cef7531a182dcf122ddb2ea695628b4d083bd8.tar.gz volse-hubzilla-66cef7531a182dcf122ddb2ea695628b4d083bd8.tar.bz2 volse-hubzilla-66cef7531a182dcf122ddb2ea695628b4d083bd8.zip |
don't wipe out the item body of a linked item to a photo when doing a normal delete and not forced
-rwxr-xr-x | include/items.php | 25 |
1 files changed, 18 insertions, 7 deletions
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; } |