Merge pull request #57743 from nextcloud/backport/54082/stable31

[stable31] fix(userconfig): duplicate core lexicon
This commit is contained in:
Andy Scherzinger 2026-01-26 00:06:41 +01:00 committed by GitHub
commit f5c279ac1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 47 deletions

View file

@ -21,6 +21,8 @@ use NCU\Config\ValueType;
class ConfigLexicon implements IConfigLexicon {
public const UNIFIED_SEARCH_MIN_SEARCH_LENGTH = 'unified_search_min_search_length';
public const UNIFIED_SEARCH_MAX_RESULTS_PER_REQUEST = 'unified_search_max_results_per_request';
public const USER_LANGUAGE = 'lang';
public const LASTCRON_TIMESTAMP = 'lastcron';
public function getStrictness(): ConfigLexiconStrictness {
return ConfigLexiconStrictness::IGNORE;
@ -30,11 +32,13 @@ class ConfigLexicon implements IConfigLexicon {
return [
new ConfigLexiconEntry(self::UNIFIED_SEARCH_MIN_SEARCH_LENGTH, ValueType::INT, 1, 'Minimum search length to trigger the request', lazy: false),
new ConfigLexiconEntry(self::UNIFIED_SEARCH_MAX_RESULTS_PER_REQUEST, ValueType::INT, 25, 'Maximum number of results returned per request', lazy: false),
new ConfigLexiconEntry(self::LASTCRON_TIMESTAMP, ValueType::INT, 0, 'timestamp of last cron execution'),
];
}
public function getUserConfigs(): array {
return [
new ConfigLexiconEntry(self::USER_LANGUAGE, ValueType::STRING, null, 'language'),
];
}
}

View file

@ -1183,7 +1183,6 @@ return array(
'OC\\Comments\\Manager' => $baseDir . '/lib/private/Comments/Manager.php',
'OC\\Comments\\ManagerFactory' => $baseDir . '/lib/private/Comments/ManagerFactory.php',
'OC\\Config' => $baseDir . '/lib/private/Config.php',
'OC\\Config\\Lexicon\\CoreConfigLexicon' => $baseDir . '/lib/private/Config/Lexicon/CoreConfigLexicon.php',
'OC\\Config\\UserConfig' => $baseDir . '/lib/private/Config/UserConfig.php',
'OC\\Console\\Application' => $baseDir . '/lib/private/Console/Application.php',
'OC\\Console\\TimestampFormatter' => $baseDir . '/lib/private/Console/TimestampFormatter.php',

View file

@ -1232,7 +1232,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OC\\Comments\\Manager' => __DIR__ . '/../../..' . '/lib/private/Comments/Manager.php',
'OC\\Comments\\ManagerFactory' => __DIR__ . '/../../..' . '/lib/private/Comments/ManagerFactory.php',
'OC\\Config' => __DIR__ . '/../../..' . '/lib/private/Config.php',
'OC\\Config\\Lexicon\\CoreConfigLexicon' => __DIR__ . '/../../..' . '/lib/private/Config/Lexicon/CoreConfigLexicon.php',
'OC\\Config\\UserConfig' => __DIR__ . '/../../..' . '/lib/private/Config/UserConfig.php',
'OC\\Console\\Application' => __DIR__ . '/../../..' . '/lib/private/Console/Application.php',
'OC\\Console\\TimestampFormatter' => __DIR__ . '/../../..' . '/lib/private/Console/TimestampFormatter.php',

View file

@ -11,7 +11,6 @@ namespace OC\AppFramework\Bootstrap;
use Closure;
use NCU\Config\Lexicon\IConfigLexicon;
use OC\Config\Lexicon\CoreConfigLexicon;
use OC\Support\CrashReport\Registry;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
@ -144,7 +143,7 @@ class RegistrationContext {
private array $declarativeSettings = [];
/** @var array<array-key, string> */
private array $configLexiconClasses = ['core' => CoreConfigLexicon::class];
private array $configLexiconClasses = [];
/** @var ServiceRegistration<ITeamResourceProvider>[] */
private array $teamResourceProviders = [];

View file

@ -1,43 +0,0 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Config\Lexicon;
use NCU\Config\Lexicon\ConfigLexiconEntry;
use NCU\Config\Lexicon\ConfigLexiconStrictness;
use NCU\Config\Lexicon\IConfigLexicon;
use NCU\Config\ValueType;
/**
* ConfigLexicon for 'core' app/user configs
*/
class CoreConfigLexicon implements IConfigLexicon {
public function getStrictness(): ConfigLexiconStrictness {
return ConfigLexiconStrictness::IGNORE;
}
/**
* @inheritDoc
* @return ConfigLexiconEntry[]
*/
public function getAppConfigs(): array {
return [
new ConfigLexiconEntry('lastcron', ValueType::INT, 0, 'timestamp of last cron execution'),
];
}
/**
* @inheritDoc
* @return ConfigLexiconEntry[]
*/
public function getUserConfigs(): array {
return [
new ConfigLexiconEntry('lang', ValueType::STRING, null, 'language'),
];
}
}