[TASK] Allow strings in site configuration type "select" 49/59649/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 6 Feb 2019 07:49:47 +0000 (08:49 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 8 Feb 2019 07:54:37 +0000 (08:54 +0100)
To allow more usecases for extending the site configuration,
the value of tca type select should only be typecasted
if it looks like an integer.

Resolves: #87663
Releases: master, 9.5
Change-Id: I700bba3ac67ceac9acc8aa473d1b723b4bc34f4f
Reviewed-on: https://review.typo3.org/59649
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php

index 7bd447d..c06c418 100644 (file)
@@ -42,6 +42,7 @@ use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Site\SiteFinder;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 use TYPO3\CMS\Frontend\Page\PageRepository;
 use TYPO3Fluid\Fluid\View\ViewInterface;
@@ -300,7 +301,7 @@ class SiteConfigurationController
                         break;
 
                     case 'select':
-                        $newSysSiteData[$fieldName] = (int)$fieldValue;
+                        $newSysSiteData[$fieldName] = MathUtility::canBeInterpretedAsInteger($fieldValue) ? (int)$fieldValue : $fieldValue;
                         break;
 
                     default: