[BUGFIX] Language label overrides for select fields not respected 15/56515/2
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 2 Apr 2018 22:01:47 +0000 (18:01 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 2 Apr 2018 22:04:35 +0000 (00:04 +0200)
Language label overrides for simple select fields not respected in
create/edit forms.

Resolves: #84077
Change-Id: Ifebdb1389421a66a692d7e67e4bc0edc75653dfb
Reviewed-on: https://review.typo3.org/56515
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
ChangeLog
Classes/Utility/LocalizationUtility.php
Classes/View/Marker.php

index 491bfb0..46f881c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2018-04-02 Stanislas Rolland  <typo3(arobas)sjbr.ca>
        * Resolves #84076: Honour TS setup delete = 0
+       * Resolves #84077: Language label overrides for select fields not respected in forms
 
 2018-02-09 Stanislas Rolland  <typo3(arobas)sjbr.ca>
        * Resolves #83833: Salutation does not match in registration and response for "Ms" and "Mrs"
index a02a98c..9ad8df1 100644 (file)
@@ -4,7 +4,7 @@ namespace SJBR\SrFeuserRegister\Utility;
 /*
  *  Copyright notice
  *
- *  (c) 2015-2017 Stanislas Rolland <typo3(arobas)sjbr.ca>
+ *  (c) 2015-2018 Stanislas Rolland <typo3(arobas)sjbr.ca>
  *  All rights reserved
  *
  *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -23,7 +23,7 @@ namespace SJBR\SrFeuserRegister\Utility;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
+use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 
 /**
@@ -81,7 +81,7 @@ class LocalizationUtility
                        return;
                }
                $configurationManager = static::getConfigurationManager();
-               $settings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, $extensionName);
+               $settings = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, $extensionName);
                if (isset($settings['salutation']) && in_array($settings['salutation'], self::$allowedSuffixes, true)) {
                        self::$suffix = ($settings['salutation'] === 'formal' ? '' : $settings['salutation']);
                } else {
@@ -99,7 +99,7 @@ class LocalizationUtility
                        return static::$configurationManager;
                }
                $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
-               $configurationManager = $objectManager->get(ConfigurationManager::class);
+               $configurationManager = $objectManager->get(ConfigurationManagerInterface::class);
                static::$configurationManager = $configurationManager;
                return $configurationManager;
        }
index 5c49455..cc85007 100644 (file)
@@ -4,7 +4,7 @@ namespace SJBR\SrFeuserRegister\View;
 /*
  *  Copyright notice
  *
- *  (c) 2007-2017 Stanislas Rolland <typo3(arobas)sjbr.ca>
+ *  (c) 2007-2018 Stanislas Rolland <typo3(arobas)sjbr.ca>
  *  All rights reserved
  *
  *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -1647,7 +1647,7 @@ class Marker
                                                                        $i = 0;
                                                                        foreach ($itemArray as $k => $item)     {
                                                                                $label = LocalizationUtility::translate(substr(strrchr($item[0], ':'), 1), $this->extensionName);
-                                                                               $label = LocalizationUtility::translate($item[0], $this->extensionName);
+                                                                               $label = $label ?: LocalizationUtility::translate($item[0], $this->extensionName);
                                                                                $label = $label ?: $item[0];
                                                                                $label = $label ? htmlspecialchars($label, ENT_QUOTES, $charset) : '';
                                                                                if ($colConfig['renderMode'] === 'checkbox') {