mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-30 18:49:24 +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,8 +1347,13 @@ 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
|
||||
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))
|
||||
{
|
||||
Vfs::$is_root = $current_is_root;
|
||||
|
Loading…
Reference in New Issue
Block a user