2 namespace TYPO3\CMS\Install\Updates;
28 protected $title =
'Update sys_language records to use new ISO 639-1 letter-code field';
43 $migratableLanguageRecords = $this->
getDatabaseConnection()->exec_SELECTcountRows(
'uid',
'sys_language',
'language_isocode=' . $emptyValue .
' AND CAST(static_lang_isocode AS CHAR) != ' . $emptyValue);
44 if ($migratableLanguageRecords === 0) {
48 $description =
'The sys_language records have a new iso code field which removes the dependency of the TYPO3 CMS Core to the extension "static_info_tables". This upgrade wizard migrates the data of the existing "static_lang_isocode" field to the new DB field.';
62 public function performUpdate(array &$databaseQueries, &$customMessages)
65 $migrateableLanguageRecords = $this->
getDatabaseConnection()->exec_SELECTgetRows(
'uid,static_lang_isocode',
'sys_language',
'language_isocode=' . $emptyValue .
' AND CAST(static_lang_isocode AS CHAR) != ' . $emptyValue);
66 if (!empty($migrateableLanguageRecords)) {
67 foreach ($migrateableLanguageRecords as $languageRecord) {
68 $staticLanguageRecord = $this->
getDatabaseConnection()->exec_SELECTgetSingleRow(
'*',
'static_languages',
'uid=' . (
int)$languageRecord[
'static_lang_isocode']);
69 if (!empty($staticLanguageRecord[
'lg_iso_2'])) {
72 'uid=' . (
int)$languageRecord[
'uid'],
74 'language_isocode' => strtolower($staticLanguageRecord[
'lg_iso_2'])