[BUGFIX] Use compiled system language rows 53/44253/4
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Fri, 23 Oct 2015 20:22:50 +0000 (22:22 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 29 Oct 2015 19:38:20 +0000 (20:38 +0100)
The todo stated that we should use available languages
from the data provider result. I agree.

Remove hidden = 0, to show also hidden languages in the
sys_language_uid select boxes.

Resolves: #69816
Releases: master
Change-Id: I16b128889de7387f3dfc38dd8bc9ad61bb880cd8
Reviewed-on: https://review.typo3.org/44253
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseSystemLanguageRows.php

index 4526c21..aa1fd1f 100644 (file)
@@ -248,16 +248,12 @@ abstract class AbstractItemProvider
                 }
             }
         } elseif ($special === 'languages') {
-            // @todo: This should probably use the data provided by DatabaseSystemLanguageRows sitting in $result['systemLanguageRows']
-            /** @var TranslationConfigurationProvider $translationConfigurationProvider */
-            $translationConfigurationProvider = GeneralUtility::makeInstance(TranslationConfigurationProvider::class);
-            $languages = $translationConfigurationProvider->getSystemLanguages();
-            foreach ($languages as $language) {
+            foreach ($result['systemLanguageRows'] as $language) {
                 if ($language['uid'] !== -1) {
                     $items[] = [
                         0 => $language['title'] . ' [' . $language['uid'] . ']',
                         1 => $language['uid'],
-                        2 => $language['flagIcon']
+                        2 => $language['flagIconIdentifier']
                     ];
                 }
             }
index 8863b62..10f26d4 100644 (file)
@@ -74,7 +74,7 @@ class DatabaseSystemLanguageRows implements FormDataProviderInterface
         $dbRows = $database->exec_SELECTgetRows(
             'uid,title,language_isocode,static_lang_isocode,flag',
             'sys_language',
-            'pid=0 AND hidden=0'
+            'pid=0'
         );
 
         if ($dbRows === null) {