From fbc849fc36dab4599c6ecc6028c84bacb6ce8ff9 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 12 Sep 2019 01:13:52 +0200 Subject: [PATCH] Modify special case for SQLite --- app/Models/DatabaseDAO.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php index d4ba375eb..b8dc56c24 100644 --- a/app/Models/DatabaseDAO.php +++ b/app/Models/DatabaseDAO.php @@ -191,8 +191,14 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo { $nbEntries = $entryDAO->countUnreadRead(); if (!empty($nbEntries['all'])) { $error = 'Error: Destination database already contains some entries!'; + break; } } + if ($this->bd->dbType() === 'sqlite') { + //For importing to SQLite, we can just copy the SQLite source (issues when using another PDO) + copy($filename, join_path(DATA_PATH, 'users', $this->current_user, 'db.sqlite')); + goto done; + } break; default: $error = 'Invalid copy mode!'; @@ -202,12 +208,6 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo { goto done; } - if ($this->bd->dbType() === 'sqlite') { - //For importing to SQLite, we cannot have two PDO instances at the same time but we can just copy the SQLite source - copy($filename, join_path(DATA_PATH, 'users', $this->current_user, 'db.sqlite')); - goto done; - } - $sqlite = null; try {