From 37a9711b19208c0b070636c39c3aeb2bb47de084 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 27 Feb 2024 15:41:44 +0200 Subject: [PATCH] also handle and fix directories connected to itself like unconnected ones --> move to /lost+found --- api/src/Vfs/Sqlfs/Utils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/Vfs/Sqlfs/Utils.php b/api/src/Vfs/Sqlfs/Utils.php index b87ddba86c..cabcc91984 100644 --- a/api/src/Vfs/Sqlfs/Utils.php +++ b/api/src/Vfs/Sqlfs/Utils.php @@ -355,12 +355,12 @@ class Utils extends StreamWrapper const LOST_N_FOUND_GRP = 'Admins'; /** - * Check and optionally fix unconnected nodes - parent directory does not (longer) exists: + * Check and optionally fix unconnected nodes - parent directory does no (longer) exists or connected to itself: * * SELECT fs.* * FROM egw_sqlfs fs * LEFT JOIN egw_sqlfs dir ON dir.fs_id=fs.fs_dir - * WHERE fs.fs_id > 1 && dir.fs_id IS NULL + * WHERE fs.fs_id > 1 AND (dir.fs_id IS NULL OR fs.fs_id=fs.fs_dir) * * @param boolean $check_only =true * @return array with messages / found problems @@ -374,7 +374,7 @@ class Utils extends StreamWrapper $offset = 0; $stmt = self::$pdo->prepare('SELECT fs.* FROM ' . self::TABLE . ' fs' . ' LEFT JOIN ' . self::TABLE . ' dir ON dir.fs_id=fs.fs_dir' . - " WHERE fs.fs_id > 1 AND dir.fs_id IS NULL LIMIT $limit OFFSET :offset"); + " WHERE fs.fs_id > 1 AND (dir.fs_id IS NULL OR fs.fs_id=fs.fs_dir) LIMIT $limit OFFSET :offset"); $stmt->setFetchMode(PDO::FETCH_ASSOC); do {