diff --git a/admin/inc/class.admin_prefs_sidebox_hooks.inc.php b/admin/inc/class.admin_prefs_sidebox_hooks.inc.php index 4b14fb9c12..15a27b1e86 100644 --- a/admin/inc/class.admin_prefs_sidebox_hooks.inc.php +++ b/admin/inc/class.admin_prefs_sidebox_hooks.inc.php @@ -171,7 +171,7 @@ class admin_prefs_sidebox_hooks $content .= html::form('

'.($check_only&&is_array($msgs)?html::submit_button('fix', lang('Fix reported problems')):''). html::submit_button('cancel', lang('Cancel'), "window.location.href='".egw::link('/admin/index.php')."'; return false;").'

', - '',egw::link('/index.php',array('menuaction'=>'admin.admin_prefs_sidebox_hooks.fsck'))); + '','/index.php',array('menuaction'=>'admin.admin_prefs_sidebox_hooks.fsck')); $GLOBALS['egw']->framework->render($content, lang('Admin').' - '.lang('Check virtual filesystem'), true); } diff --git a/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php b/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php index a9defc523b..602278872c 100644 --- a/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php +++ b/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php @@ -1540,7 +1540,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper return $stat; } - private static $pdo_type; + public static $pdo_type; /** * Case sensitive comparison operator, for mysql we use ' COLLATE utf8_bin =' * diff --git a/phpgwapi/inc/class.sqlfs_utils.inc.php b/phpgwapi/inc/class.sqlfs_utils.inc.php index b4bc41518c..f20baaf30e 100644 --- a/phpgwapi/inc/class.sqlfs_utils.inc.php +++ b/phpgwapi/inc/class.sqlfs_utils.inc.php @@ -127,23 +127,30 @@ class sqlfs_utils extends sqlfs_stream_wrapper { if (!file_exists($phy_path=self::_fs_path($row['fs_id']))) { - egw_vfs::$is_root = true; $path = self::id2path($row['fs_id']); if ($check_only) { $msgs[] = lang('File %1 has no content in physical filesystem %2!', $path.' (#'.$row['fs_id'].')',$phy_path); } - elseif (self::unlink($path.'?storage=db')) // storage=db to not try to delete not existing phy. file - { - $msgs[] = lang('File %1 has no content in physical filesystem %2 --> file removed!',$path,$phy_path); - } else { - $msgs[] = lang('File %1 has no content in physical filesystem %2 --> failed to remove file!', - $path.' (#'.$row['fs_id'].')',$phy_path); + if (!isset($stmt)) + { + $stmt = self::$pdo->prepare('DELETE FROM '.self::TABLE.' WHERE fs_id=:fs_id'); + $stmt_props = self::$pdo->prepare('DELETE FROM '.self::PROPS_TABLE.' WHERE fs_id=:fs_id'); + } + if ($stmt->execute(array('fs_id' => $row['fs_id'])) && + $stmt_props->execute(array('fs_id' => $row['fs_id']))) + { + $msgs[] = lang('File %1 has no content in physical filesystem %2 --> file removed!',$path,$phy_path); + } + else + { + $msgs[] = lang('File %1 has no content in physical filesystem %2 --> failed to remove file!', + $path.' (#'.$row['fs_id'].')',$phy_path); + } } - egw_vfs::$is_root = false; } } if ($check_only && $msgs) @@ -226,7 +233,6 @@ class sqlfs_utils extends sqlfs_stream_wrapper if ($check_only && $msgs) { $msgs[] = lang('Unconnected nodes will be moved to %1.',self::LOST_N_FOUND); - continue; } return $msgs; } @@ -242,7 +248,7 @@ class sqlfs_utils extends sqlfs_stream_wrapper $msgs = array(); foreach(self::$pdo->query('SELECT fs_dir,fs_name,COUNT(*) FROM '.self::TABLE. ' WHERE fs_active='.self::_pdo_boolean(true). - ' GROUP BY fs_dir,fs_name'. + ' GROUP BY fs_dir,'.(self::$pdo_type == 'mysql' ? 'BINARY ' : '').'fs_name'. // fs_name is casesensitive! ' HAVING COUNT(*) > 1') as $row) { if (!isset($stmt))