diff options
author | friendica <info@friendica.com> | 2014-07-04 20:34:54 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-07-04 20:34:54 -0700 |
commit | ee3a4902def794911157843c61f27add58092dc1 (patch) | |
tree | 0a5cdbdff695d8de87d8025fa4498c1dd354696e /include | |
parent | a22ec8cbfa5ec424cce751e194943328a16c1eec (diff) | |
download | volse-hubzilla-ee3a4902def794911157843c61f27add58092dc1.tar.gz volse-hubzilla-ee3a4902def794911157843c61f27add58092dc1.tar.bz2 volse-hubzilla-ee3a4902def794911157843c61f27add58092dc1.zip |
when deleting items, delete linked events and photos during stage1
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/items.php b/include/items.php index 7bb47a284..7f4dabaa7 100755 --- a/include/items.php +++ b/include/items.php @@ -3727,19 +3727,7 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) { intval($item['uid']) ); - - // network deletion request. Keep the message structure so that we can deliver delete notifications. - // Come back after several days (or perhaps a month) to do the lowlevel delete (DROPITEM_PHASE2). - - if($stage == DROPITEM_PHASE1) - return true; - - $r = q("delete from term where otype = %d and oid = %d limit 1", - intval(TERM_OBJ_POST), - intval($item['id']) - ); - - // If item is a link to a photo resource, nuke all the associated photos + // If item is a link to a photo/event resource, nuke all the associated photos/events // This only applies to photos uploaded from the photos page. Photos inserted into a post do not // generate a resource_id and therefore aren't intimately linked to the item. @@ -3758,6 +3746,18 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) { } } + + // network deletion request. Keep the message structure so that we can deliver delete notifications. + // Come back after several days (or perhaps a month) to do the lowlevel delete (DROPITEM_PHASE2). + + if($stage == DROPITEM_PHASE1) + return true; + + $r = q("delete from term where otype = %d and oid = %d limit 1", + intval(TERM_OBJ_POST), + intval($item['id']) + ); + q("delete from item_id where iid = %d and uid = %d limit 1", intval($item['id']), intval($item['uid']) |