LanguageConverter: Only set mTablesLoaded once they're really loaded

If something inside the callback above throws an exception (e.g.
`parseCachedTable()` when the database is down), and it is caught,
`$this->mTablesLoaded` and `$this->mTables` will be left in an
inconsistent state for the rest of the request, causing confusing
errors elsewhere.

Bug: T388807
Change-Id: I79704d6d5c03d5e028c0c762a37fd55b953a4a6a
(cherry picked from commit 6d4f287059521fd4e7fe094ccb00aca54906b31f)
This commit is contained in:
Bartosz Dziewoński 2025-03-18 01:27:46 +01:00 committed by Winston Sung
parent b1d2516673
commit 0d5d80b7e1

View file

@ -1027,7 +1027,6 @@ abstract class LanguageConverter implements ILanguageConverter {
return;
}
$this->mTablesLoaded = true;
$cache = $services->getObjectCacheFactory()->getInstance( $languageConverterCacheType );
$cacheKey = $cache->makeKey(
'conversiontables', $this->getMainCode(),
@ -1048,6 +1047,7 @@ abstract class LanguageConverter implements ILanguageConverter {
$this->postLoadTables( $tables );
return $tables;
} );
$this->mTablesLoaded = true;
}
/**