diff options
Diffstat (limited to 'lib/private/repair/repairlegacystorages.php')
-rw-r--r-- | lib/private/repair/repairlegacystorages.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/repair/repairlegacystorages.php b/lib/private/repair/repairlegacystorages.php index f09ca2b5cdd..027cb68eb1b 100644 --- a/lib/private/repair/repairlegacystorages.php +++ b/lib/private/repair/repairlegacystorages.php @@ -143,6 +143,7 @@ class RepairLegacyStorages extends BasicEmitter { $dataDirId = 'local::' . $dataDir; $count = 0; + $hasWarnings = false; $this->connection->beginTransaction(); @@ -167,6 +168,7 @@ class RepairLegacyStorages extends BasicEmitter { } } catch (\OC\RepairException $e) { + $hasWarnings = true; $this->emit( '\OC\Repair', 'warning', @@ -180,6 +182,7 @@ class RepairLegacyStorages extends BasicEmitter { . ' WHERE `id` NOT LIKE \'%::%\''; $result = $this->connection->executeQuery($sql); $row = $result->fetch(); + // find at least one to make sure it's worth // querying the user list if ((int)$row['c'] > 0) { @@ -213,6 +216,7 @@ class RepairLegacyStorages extends BasicEmitter { } } catch (\OC\RepairException $e) { + $hasWarnings = true; $this->emit( '\OC\Repair', 'warning', @@ -229,6 +233,15 @@ class RepairLegacyStorages extends BasicEmitter { $this->connection->commit(); - $this->config->setAppValue('core', 'repairlegacystoragesdone', 'yes'); + if ($hasWarnings) { + $this->emit( + '\OC\Repair', + 'warning', + array('Some legacy storages could not be repaired. Please manually fix them then re-run ./occ maintenance:repair') + ); + } else { + // if all were done, no need to redo the repair during next upgrade + $this->config->setAppValue('core', 'repairlegacystoragesdone', 'yes'); + } } } |