]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add repair step to remove old dashboard app config 22382/head
authorJulius Härtl <jus@bitgrid.net>
Mon, 24 Aug 2020 08:12:25 +0000 (10:12 +0200)
committerJulius Härtl <jus@bitgrid.net>
Mon, 24 Aug 2020 08:16:15 +0000 (10:16 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/composer/composer/autoload_classmap.php
lib/composer/composer/autoload_static.php
lib/private/Repair.php
lib/private/Repair/NC20/ShippedDashboardEnable.php [new file with mode: 0644]

index c0e35fa460415f3c2c0a8c6ee1e99f494f91fd31..286c473c30514396d256db2535aa2119010c4787 100644 (file)
@@ -1250,6 +1250,7 @@ return array(
     'OC\\Repair\\NC18\\ResetGeneratedAvatarFlag' => $baseDir . '/lib/private/Repair/NC18/ResetGeneratedAvatarFlag.php',
     'OC\\Repair\\NC20\\EncryptionLegacyCipher' => $baseDir . '/lib/private/Repair/NC20/EncryptionLegacyCipher.php',
     'OC\\Repair\\NC20\\EncryptionMigration' => $baseDir . '/lib/private/Repair/NC20/EncryptionMigration.php',
+    'OC\\Repair\\NC20\\ShippedDashboardEnable' => $baseDir . '/lib/private/Repair/NC20/ShippedDashboardEnable.php',
     'OC\\Repair\\OldGroupMembershipShares' => $baseDir . '/lib/private/Repair/OldGroupMembershipShares.php',
     'OC\\Repair\\Owncloud\\DropAccountTermsTable' => $baseDir . '/lib/private/Repair/Owncloud/DropAccountTermsTable.php',
     'OC\\Repair\\Owncloud\\SaveAccountsTableData' => $baseDir . '/lib/private/Repair/Owncloud/SaveAccountsTableData.php',
index a1786bc1de07e01a66620781d871f203224f3c08..b9208db1fd6f0ad8f6f118894013eff9417dc35e 100644 (file)
@@ -1279,6 +1279,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
         'OC\\Repair\\NC18\\ResetGeneratedAvatarFlag' => __DIR__ . '/../../..' . '/lib/private/Repair/NC18/ResetGeneratedAvatarFlag.php',
         'OC\\Repair\\NC20\\EncryptionLegacyCipher' => __DIR__ . '/../../..' . '/lib/private/Repair/NC20/EncryptionLegacyCipher.php',
         'OC\\Repair\\NC20\\EncryptionMigration' => __DIR__ . '/../../..' . '/lib/private/Repair/NC20/EncryptionMigration.php',
+        'OC\\Repair\\NC20\\ShippedDashboardEnable' => __DIR__ . '/../../..' . '/lib/private/Repair/NC20/ShippedDashboardEnable.php',
         'OC\\Repair\\OldGroupMembershipShares' => __DIR__ . '/../../..' . '/lib/private/Repair/OldGroupMembershipShares.php',
         'OC\\Repair\\Owncloud\\DropAccountTermsTable' => __DIR__ . '/../../..' . '/lib/private/Repair/Owncloud/DropAccountTermsTable.php',
         'OC\\Repair\\Owncloud\\SaveAccountsTableData' => __DIR__ . '/../../..' . '/lib/private/Repair/Owncloud/SaveAccountsTableData.php',
index 4ad21e742387221491ae2a35554b711ad8cdcd86..bba797a098ddd3c3d0c81507cd62852aa596916e 100644 (file)
@@ -50,6 +50,7 @@ use OC\Repair\NC16\ClearCollectionsAccessCache;
 use OC\Repair\NC18\ResetGeneratedAvatarFlag;
 use OC\Repair\NC20\EncryptionLegacyCipher;
 use OC\Repair\NC20\EncryptionMigration;
+use OC\Repair\NC20\ShippedDashboardEnable;
 use OC\Repair\OldGroupMembershipShares;
 use OC\Repair\Owncloud\DropAccountTermsTable;
 use OC\Repair\Owncloud\SaveAccountsTableData;
@@ -160,6 +161,7 @@ class Repair implements IOutput {
                        \OC::$server->query(ResetGeneratedAvatarFlag::class),
                        \OC::$server->query(EncryptionLegacyCipher::class),
                        \OC::$server->query(EncryptionMigration::class),
+                       \OC::$server->get(ShippedDashboardEnable::class),
                ];
        }
 
diff --git a/lib/private/Repair/NC20/ShippedDashboardEnable.php b/lib/private/Repair/NC20/ShippedDashboardEnable.php
new file mode 100644 (file)
index 0000000..f35a795
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * @copyright Copyright (c) 2020 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+declare(strict_types=1);
+
+
+namespace OC\Repair\NC20;
+
+use OCP\IConfig;
+use OCP\Migration\IOutput;
+use OCP\Migration\IRepairStep;
+
+class ShippedDashboardEnable implements IRepairStep {
+
+       /** @var IConfig */
+       private $config;
+
+       public function __construct(IConfig $config) {
+               $this->config = $config;
+       }
+
+       public function getName() {
+               return 'Remove old dashboard app config data';
+       }
+
+       public function run(IOutput $output) {
+               $version = $this->config->getAppValue('dashboard', 'version', '7.0.0');
+               if (version_compare($version, '7.0.0', '<')) {
+                       $this->config->deleteAppValues('dashboard');
+                       $output->info('Removed old dashboard app config');
+               }
+       }
+}