Skip to content

Commit

Permalink
[TASK] Allow strings in site configuration type "select"
Browse files Browse the repository at this point in the history
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/59666
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
  • Loading branch information
georgringer authored and bmack committed Feb 8, 2019
1 parent d6378e5 commit 3fc7994
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
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;
Expand Down Expand Up @@ -300,7 +301,7 @@ protected function saveAction(ServerRequestInterface $request): ResponseInterfac
break;

case 'select':
$newSysSiteData[$fieldName] = (int)$fieldValue;
$newSysSiteData[$fieldName] = MathUtility::canBeInterpretedAsInteger($fieldValue) ? (int)$fieldValue : $fieldValue;
break;

default:
Expand Down

0 comments on commit 3fc7994

Please sign in to comment.