nextcloud/tests/lib/Config
Anna Larch 0555ba8d13 fix(appconfig,userconfig): restore pre-migration fallback for ownCloud migration
AppConfig and UserConfig unconditionally queried NC-only columns (type,
lazy, flags, indexed) that don't exist in ownCloud's database schema,
breaking ownCloud → Nextcloud upgrades entirely before the schema
migration steps could run.

Restore the fallback pattern in both classes: on first loadConfig() call,
if a DBException with REASON_INVALID_FIELD_NAME is thrown, set
$migrationCompleted = false and retry selecting only the columns present
in ownCloud's schema. INSERT and UPDATE statements also omit NC-only
columns when $migrationCompleted is false.

The catch block also guards against infinite recursion: if $migrationCompleted
is already false when the exception fires, the exception is re-thrown
instead of triggering another recursive call.

Fixes: https://github.com/nextcloud/server/issues/57340

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 18:42:40 +00:00
..
LexiconTest.php fix(userconfig): using api bit functions 2025-09-17 18:07:01 +00:00
TestConfigLexicon_I.php feat(lexicon): moving out from unstable 2025-07-24 15:56:33 -01:00
TestLexicon_E.php feat(lexicon): moving out from unstable 2025-07-24 15:56:33 -01:00
TestLexicon_N.php feat(lexicon): moving out from unstable 2025-07-24 15:56:33 -01:00
TestLexicon_UserIndexed.php fix(userconfig): using api bit functions 2025-09-17 18:07:01 +00:00
TestLexicon_UserIndexedRemove.php fix(userconfig): using api bit functions 2025-09-17 18:07:01 +00:00
TestLexicon_W.php feat(lexicon): moving out from unstable 2025-07-24 15:56:33 -01:00
UserConfigMigrationFallbackTest.php fix(appconfig,userconfig): restore pre-migration fallback for ownCloud migration 2026-05-28 18:42:40 +00:00
UserConfigTest.php fix(config): fix tests+psalm 2025-08-08 11:00:49 -01:00