Merge pull request #55139 from nextcloud/fix/noid/index-settings-mail-on-upgrade
fix(userconfig): set 'mail' as indexedpull/54963/merge
commit
22c0e76e23
@ -0,0 +1,38 @@ |
||||
<?php |
||||
|
||||
declare(strict_types=1); |
||||
|
||||
/** |
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
||||
* SPDX-License-Identifier: AGPL-3.0-or-later |
||||
*/ |
||||
namespace OCA\Settings; |
||||
|
||||
use OCP\Config\IUserConfig; |
||||
use OCP\Config\Lexicon\Entry; |
||||
use OCP\Config\Lexicon\ILexicon; |
||||
use OCP\Config\Lexicon\Strictness; |
||||
use OCP\Config\ValueType; |
||||
|
||||
/** |
||||
* Config Lexicon for settings. |
||||
* |
||||
* Please Add & Manage your Config Keys in that file and keep the Lexicon up to date! |
||||
*/ |
||||
class ConfigLexicon implements ILexicon { |
||||
public const USER_SETTINGS_EMAIL = 'email'; |
||||
|
||||
public function getStrictness(): Strictness { |
||||
return Strictness::IGNORE; |
||||
} |
||||
|
||||
public function getAppConfigs(): array { |
||||
return []; |
||||
} |
||||
|
||||
public function getUserConfigs(): array { |
||||
return [ |
||||
new Entry(key: self::USER_SETTINGS_EMAIL, type: ValueType::STRING, defaultRaw: '', definition: 'account mail address', flags: IUserConfig::FLAG_INDEXED), |
||||
]; |
||||
} |
||||
} |
@ -0,0 +1,33 @@ |
||||
<?php |
||||
|
||||
declare(strict_types=1); |
||||
/** |
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
||||
* SPDX-License-Identifier: AGPL-3.0-only |
||||
*/ |
||||
|
||||
namespace Tests\lib\Config; |
||||
|
||||
use OCP\Config\IUserConfig; |
||||
use OCP\Config\Lexicon\Entry; |
||||
use OCP\Config\Lexicon\ILexicon; |
||||
use OCP\Config\Lexicon\Strictness; |
||||
use OCP\Config\ValueType; |
||||
|
||||
class TestLexicon_UserIndexed implements ILexicon { |
||||
public const APPID = 'lexicon_user_indexed'; |
||||
public function getStrictness(): Strictness { |
||||
return Strictness::EXCEPTION; |
||||
} |
||||
|
||||
public function getAppConfigs(): array { |
||||
return [ |
||||
]; |
||||
} |
||||
|
||||
public function getUserConfigs(): array { |
||||
return [ |
||||
new Entry(key: 'key1', type: ValueType::STRING, defaultRaw: '', definition: 'test key', flags: IUserConfig::FLAG_INDEXED), |
||||
]; |
||||
} |
||||
} |
@ -0,0 +1,32 @@ |
||||
<?php |
||||
|
||||
declare(strict_types=1); |
||||
/** |
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
||||
* SPDX-License-Identifier: AGPL-3.0-only |
||||
*/ |
||||
|
||||
namespace Tests\lib\Config; |
||||
|
||||
use OCP\Config\Lexicon\Entry; |
||||
use OCP\Config\Lexicon\ILexicon; |
||||
use OCP\Config\Lexicon\Strictness; |
||||
use OCP\Config\ValueType; |
||||
|
||||
class TestLexicon_UserIndexedRemove implements ILexicon { |
||||
public const APPID = 'lexicon_user_not_indexed'; |
||||
public function getStrictness(): Strictness { |
||||
return Strictness::EXCEPTION; |
||||
} |
||||
|
||||
public function getAppConfigs(): array { |
||||
return [ |
||||
]; |
||||
} |
||||
|
||||
public function getUserConfigs(): array { |
||||
return [ |
||||
new Entry(key: 'key1', type: ValueType::STRING, defaultRaw: '', definition: 'test key'), |
||||
]; |
||||
} |
||||
} |
Loading…
Reference in new issue