[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>
Sat, 11 Feb 2012 07:56:38 +0000 (08:56 +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: I183b5ffa385e9d218f4942a57abd4e6a01e194fb
Fixes: #28298
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/8960
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
t3lib/class.t3lib_tcemain.php

index 153ce9b..4ef63ec 100644 (file)
@@ -1366,7 +1366,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'];
                        }