mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-28 01:29:05 +01:00
* PostgreSQL: fix SQL error when accessing eg. InfoLog
Links class trys to delete empty attachment directories and virtual / empty attachment directories have non-integer (hash) id causing an SQL error in PostgreSQL.
This commit is contained in:
parent
c609485fe4
commit
226ee1485d
@ -867,7 +867,7 @@ class Link extends Link\Storage
|
||||
if ($id && is_null($title)) // $app,$id has been deleted ==> unlink all links to it
|
||||
{
|
||||
static $unlinking = array();
|
||||
// check if we are already trying to unlink the entry, to avoid an infinit recursion
|
||||
// check if we are already trying to unlink the entry, to avoid an infinite recursion
|
||||
if (!isset($unlinking[$app]) || !isset($unlinking[$app][$id]))
|
||||
{
|
||||
$unlinking[$app][$id] = true;
|
||||
@ -1347,7 +1347,12 @@ class Link extends Link\Storage
|
||||
if (($Ok = !file_exists($url) || Vfs::remove($url,true)) && ((int)$app > 0 || $fname))
|
||||
{
|
||||
// try removing the dir, in case it's empty
|
||||
if (($dir = Vfs::dirname($url))) @Vfs::rmdir($dir);
|
||||
try {
|
||||
if (($dir = Vfs::dirname($url))) @Vfs::rmdir($dir);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
// ignore SQL error caused by only virtual directories with non-integer (hash) fs_id
|
||||
}
|
||||
}
|
||||
if (!is_null($current_is_root))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user