Skip to content

Commit b681a6a

Browse files
nickvergessenbackportbot[bot]
authored andcommitted
fix(dav): Skip removal of classified activity only once
Was fixed in Nextcloud 16, so future versions should not generate this anymore. So the delete attempt can be skipped, after doing it once. We are keeping this to ensure it also runs after migrating from ownCloud Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 9c5a5e7 commit b681a6a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

apps/dav/lib/Migration/RemoveClassifiedEventActivity.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace OCA\DAV\Migration;
1010

1111
use OCA\DAV\CalDAV\CalDavBackend;
12+
use OCP\AppFramework\Services\IAppConfig;
1213
use OCP\IDBConnection;
1314
use OCP\Migration\IOutput;
1415
use OCP\Migration\IRepairStep;
@@ -17,6 +18,7 @@ class RemoveClassifiedEventActivity implements IRepairStep {
1718

1819
public function __construct(
1920
private IDBConnection $connection,
21+
private IAppConfig $appConfig,
2022
) {
2123
}
2224

@@ -31,12 +33,17 @@ public function getName() {
3133
* @inheritdoc
3234
*/
3335
public function run(IOutput $output) {
36+
if ($this->appConfig->getAppValueBool('checked_for_classified_activity')) {
37+
return;
38+
}
39+
3440
if (!$this->connection->tableExists('activity')) {
3541
return;
3642
}
3743

3844
$deletedEvents = $this->removePrivateEventActivity();
3945
$deletedEvents += $this->removeConfidentialUncensoredEventActivity();
46+
$this->appConfig->setAppValueBool('checked_for_classified_activity', true);
4047

4148
$output->info("Removed $deletedEvents activity entries");
4249
}

0 commit comments

Comments
 (0)