diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-06-12 11:27:39 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-06-12 11:27:39 +0200 |
commit | decd0dc035cce0918519bef77742ff87db23e3f3 (patch) | |
tree | 552bd635f1a20b25e50837f18064ca0103f19278 /include/items.php | |
parent | 9ac9c693adaa6d3262e1a8639c83474419059730 (diff) | |
download | volse-hubzilla-decd0dc035cce0918519bef77742ff87db23e3f3.tar.gz volse-hubzilla-decd0dc035cce0918519bef77742ff87db23e3f3.tar.bz2 volse-hubzilla-decd0dc035cce0918519bef77742ff87db23e3f3.zip |
more work on event item deletion
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php index 95b696034..b6d8eb652 100755 --- a/include/items.php +++ b/include/items.php @@ -3740,6 +3740,13 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL,$force = fal if($ok_to_delete) { + if ($item['resource_type'] === 'event') { + $x = q("delete from event where event_hash = '%s' and uid = %d", + dbesc($item['resource_id']), + intval($item['uid']) + ); + } + // set the deleted flag immediately on this item just in case the // hook calls a remote process which loops. We'll delete it properly in a second. @@ -3816,7 +3823,10 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL,$force = fal */ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL, $force = false) { - $linked_item = (($item['resource_id']) ? true : false); + //$linked_item = (($item['resource_id']) ? true : false); + + $linked_resource_types = [ 'photo' ]; + $linked_item = (($item['resource_id'] && $item['resource_type'] && in_array($item['resource_type'], $linked_resource_types)) ? true : false); logger('item: ' . $item['id'] . ' stage: ' . $stage . ' force: ' . $force, LOGGER_DATA); |