[BUGFIX] Resetting of input field to default when having a range fails
authorPhilipp Kitzberger <philipp@cron-it.de>
Wed, 28 Dec 2011 10:28:01 +0000 (11:28 +0100)
committerTolleiv Nietsch <info@tolleiv.de>
Fri, 10 Feb 2012 08:02:01 +0000 (09:02 +0100)
When trying to reset a endtime (datetime or date) having a range (like tt_news
articles) the lower range limit will be stored instead of the default value.

Change-Id: Ib9947ddc147aa62ca4136301f2e4fcce6917d9a8
Fixes: #28298
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7624
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
t3lib/class.t3lib_tcemain.php

index 529be57..7b05806 100644 (file)
@@ -1186,7 +1186,7 @@ class t3lib_TCEmain {
                }
 
                        // Checking range of value:
-               if ($tcaFieldConf['range'] && $value != $tcaFieldConf['checkbox'] && $value != $tcaFieldConf['default']) {
+               if ($tcaFieldConf['range'] && $value != $tcaFieldConf['checkbox'] && intval($value) !== intval($tcaFieldConf['default'])) {
                        if (isset($tcaFieldConf['range']['upper']) && $value > $tcaFieldConf['range']['upper']) {
                                $value = $tcaFieldConf['range']['upper'];
                        }