only history-log and notify, if there were any links deleted

This commit is contained in:
ralf 2024-10-15 14:38:16 +02:00
parent 7cb135c43e
commit 6b13b909ff

View File

@ -735,16 +735,17 @@ class Link extends Link\Storage
$app2 = $link['link_app2']; $app2 = $link['link_app2'];
$id2 = $link['link_id2']; $id2 = $link['link_id2'];
} }
// only history-log and notify, if there were any links deleted
if (($deleted = Link\Storage::unlink($link_id,$app,$id,$owner,$app2 != '!'.self::VFS_APPNAME ? $app2 : '',$id2,$hold_for_purge)))
{
if ($app && $app2) if ($app && $app2)
{ {
Storage\History::static_add($app,$id,$GLOBALS['egw_info']['user']['account_id'],'~link~','',$app2.':'.$id2); Storage\History::static_add($app,$id,$GLOBALS['egw_info']['user']['account_id'],'~link~','',$app2.':'.$id2);
Storage\History::static_add($app2,$id2,$GLOBALS['egw_info']['user']['account_id'],'~link~','',$app.':'.$id); Storage\History::static_add($app2,$id2,$GLOBALS['egw_info']['user']['account_id'],'~link~','',$app.':'.$id);
} }
$deleted = Link\Storage::unlink($link_id,$app,$id,$owner,$app2 != '!'.self::VFS_APPNAME ? $app2 : '',$id2,$hold_for_purge);
// only notify on real links, not the one cached for writing or fileattachments // only notify on real links, not the one cached for writing or fileattachments
self::notify_unlink($deleted); self::notify_unlink($deleted);
}
return count($deleted); return count($deleted);
} }
if (!$link_id) $link_id = self::temp_link_id($app2,$id2); // create link_id of temporary link, if not given if (!$link_id) $link_id = self::temp_link_id($app2,$id2); // create link_id of temporary link, if not given