[BUGFIX] Site Configuration Module shows hidden languages 61/58061/3
authorBenni Mack <benni@typo3.org>
Tue, 28 Aug 2018 14:33:41 +0000 (16:33 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 28 Aug 2018 16:53:51 +0000 (18:53 +0200)
Site Languages which are not shown in the frontend should be displayed
in the Backend module however this is a bug that Fluid accesses only
enabled languages, but needs to use "getAllLanguages()" instead.

Resolves: #86011
Releases: master
Change-Id: I24880604675b7d0bb5ced8169a2e3f461afa8dfb
Reviewed-on: https://review.typo3.org/58061
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jan Stockfisch <typo3@jan-stockfisch.de>
Tested-by: Jan Stockfisch <typo3@jan-stockfisch.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php
typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Overview.html
typo3/sysext/core/Classes/Site/Entity/SiteLanguage.php

index 5ba8531..d7330f0 100644 (file)
@@ -39,7 +39,6 @@ use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
-use TYPO3\CMS\Core\Site\Entity\Site;
 use TYPO3\CMS\Core\Site\SiteFinder;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
index f50c6ae..e022304 100644 (file)
                                                        <f:if condition="{page.siteConfiguration}">
                                                                <table class="table table-striped table-no-borders">
                                                                        <tr>
-                                                                               <th>Language Name</th>
+                                                                               <th>Language</th>
                                                                                <th>Full URL Prefix</th>
                                                                        </tr>
-                                                               <f:for each="{page.siteConfiguration.languages}" as="siteLanguage">
+                                                               <f:for each="{page.siteConfiguration.allLanguages}" as="siteLanguage">
                                                                        <tr>
-                                                                               <td><core:icon identifier="{siteLanguage.flagIdentifier}" /> {siteLanguage.title}</td>
+                                                                               <td>
+                                                                                       <f:if condition="{siteLanguage.enabled}">
+                                                                                               <f:then>
+                                                                                                       <core:icon identifier="{siteLanguage.flagIdentifier}" /> {siteLanguage.title}
+                                                                                               </f:then>
+                                                                                               <f:else>
+                                                                                                       <core:icon identifier="{siteLanguage.flagIdentifier}" overlay="overlay-hidden" /> <span class="text-muted">{siteLanguage.title} (<f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:disabled">disabled</f:translate>)</span>
+                                                                                               </f:else>
+                                                                                       </f:if>
+                                                                               </td>
                                                                                <td><a href="{siteLanguage.base}" target="_blank">{siteLanguage.base}</a></td>
                                                                        </tr>
                                                                </f:for>
index fb93e0f..7b5be8a 100644 (file)
@@ -278,6 +278,16 @@ class SiteLanguage
     }
 
     /**
+     * Helper so fluid can work with this as well.
+     *
+     * @return bool
+     */
+    public function isEnabled(): bool
+    {
+        return $this->enabled;
+    }
+
+    /**
      * @return string
      */
     public function getFallbackType(): string