Skip to content

Commit c24cf8d

Browse files
committed
fix: add a config lexicon entry
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
1 parent f119f8c commit c24cf8d

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

core/AppInfo/ConfigLexicon.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class ConfigLexicon implements ILexicon {
2929
public const USER_LANGUAGE = 'lang';
3030
public const OCM_DISCOVERY_ENABLED = 'ocm_discovery_enabled';
3131
public const OCM_INVITE_ACCEPT_DIALOG = 'ocm_invite_accept_dialog';
32+
public const DAV_REPAIR_REMOVED_BROKEN_PROPERTIES = 'dav_repair_removed_broken_properties';
3233

3334
public const USER_LOCALE = 'locale';
3435
public const USER_TIMEZONE = 'timezone';
@@ -103,6 +104,13 @@ public function getAppConfigs(): array {
103104
defaultRaw: true,
104105
definition: 'Whether on demand preview migration is enabled.'
105106
),
107+
new Entry(
108+
key: self::DAV_REPAIR_REMOVED_BROKEN_PROPERTIES,
109+
type: ValueType::BOOL,
110+
defaultRaw: false,
111+
definition: 'Whether the RemoveBrokenProperties repair step has already been run.',
112+
lazy: true,
113+
),
106114
];
107115
}
108116

lib/private/Repair/RemoveBrokenProperties.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use Override;
1818

1919
class RemoveBrokenProperties implements IRepairStep {
20+
public const GUARD_CONFIG_KEY = 'dav_repair_removed_broken_properties';
21+
2022
public function __construct(
2123
private readonly IDBConnection $db,
2224
private readonly IAppConfig $appConfig,
@@ -30,7 +32,7 @@ public function getName(): string {
3032

3133
#[Override]
3234
public function run(IOutput $output): void {
33-
if ($this->appConfig->getValueBool('core', 'repair_removed_broken_properties', lazy: true)) {
35+
if ($this->appConfig->getValueBool('core', self::GUARD_CONFIG_KEY, lazy: true)) {
3436
return;
3537
}
3638

@@ -63,7 +65,7 @@ public function run(IOutput $output): void {
6365
}
6466
$total = count($brokenIds);
6567

66-
$this->appConfig->setValueBool('core', 'repair_removed_broken_properties', true, lazy: true);
68+
$this->appConfig->setValueBool('core', self::GUARD_CONFIG_KEY, true, lazy: true);
6769
$output->info("$total broken object properties removed");
6870
}
6971
}

0 commit comments

Comments
 (0)