summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-03-03 13:51:32 +0100
committerGitHub <noreply@github.com>2017-03-03 13:51:32 +0100
commit8e27b8197d8b869e8fb0d55105f9bfc2f854b381 (patch)
tree782d563a2f1e5c682da34c5de69ff43cb8ce5eb7 /lib
parentf8c459f1a4ab918193d5f65c0ad1732875426d8b (diff)
parent0beb78517fa06a27509161f5b77d1bf8fec91054 (diff)
downloadnextcloud-server-8e27b8197d8b869e8fb0d55105f9bfc2f854b381.tar.gz
nextcloud-server-8e27b8197d8b869e8fb0d55105f9bfc2f854b381.zip
Merge pull request #3684 from nextcloud/run-lang-update-only-once
Execute UpdateLanguageCode only once
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Repair.php2
-rw-r--r--lib/private/Repair/NC12/UpdateLanguageCodes.php18
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/private/Repair.php b/lib/private/Repair.php
index 7f142a808aa..e808774ec93 100644
--- a/lib/private/Repair.php
+++ b/lib/private/Repair.php
@@ -135,7 +135,7 @@ class Repair implements IOutput{
\OC::$server->getConfig()
),
new FixMountStorages(\OC::$server->getDatabaseConnection()),
- new UpdateLanguageCodes(\OC::$server->getDatabaseConnection()),
+ new UpdateLanguageCodes(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
];
}
diff --git a/lib/private/Repair/NC12/UpdateLanguageCodes.php b/lib/private/Repair/NC12/UpdateLanguageCodes.php
index ed65a5cbbe3..891473f51a7 100644
--- a/lib/private/Repair/NC12/UpdateLanguageCodes.php
+++ b/lib/private/Repair/NC12/UpdateLanguageCodes.php
@@ -23,6 +23,7 @@
namespace OC\Repair\NC12;
+use OCP\IConfig;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
@@ -31,11 +32,17 @@ class UpdateLanguageCodes implements IRepairStep {
/** @var IDBConnection */
private $connection;
+ /** @var IConfig */
+ private $config;
+
/**
- * @param IDBConnection $db
+ * @param IDBConnection $connection
+ * @param IConfig $config
*/
- public function __construct(IDBConnection $connection) {
+ public function __construct(IDBConnection $connection,
+ IConfig $config) {
$this->connection = $connection;
+ $this->config = $config;
}
/**
@@ -49,6 +56,13 @@ class UpdateLanguageCodes implements IRepairStep {
* {@inheritdoc}
*/
public function run(IOutput $output) {
+
+ $versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0');
+
+ if (version_compare($versionFromBeforeUpdate, '12.0.0.13', '>')) {
+ return;
+ }
+
$languages = [
'bg_BG' => 'bg',
'cs_CZ' => 'cs',