[BUGFIX] Remove obsolete checkbox code for input fields 29/44129/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 17 Oct 2015 17:32:05 +0000 (19:32 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 22 Oct 2015 16:44:54 +0000 (18:44 +0200)
Resolves: #25111
Releases: master
Change-Id: I2040b9e3dd5b6fdc17c011f2de9e8dbb8468118e
Reviewed-on: https://review.typo3.org/44129
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
15 files changed:
typo3/sysext/backend/Classes/Form/Element/InputTextElement.php
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Configuration/TCA/sys_category.php
typo3/sysext/core/Configuration/TCA/sys_collection.php
typo3/sysext/core/Configuration/TCA/sys_file_collection.php
typo3/sysext/core/Configuration/TCA/sys_file_reference.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/Comment.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/Post.php
typo3/sysext/filemetadata/Configuration/TCA/Overrides/sys_file_metadata.php
typo3/sysext/impexp/Tests/Functional/Fixtures/Extensions/impexp_group_files/Configuration/TCA/tx_impexpgroupfiles_item.php
typo3/sysext/indexed_search/Configuration/TCA/index_config.php
typo3/sysext/rsaauth/Classes/Form/Element/RsaInputElement.php
typo3/sysext/rtehtmlarea/Configuration/TCA/tx_rtehtmlarea_acronym.php
typo3/sysext/workspaces/Configuration/TCA/sys_workspace.php

index 19c4c35..2280ef2 100644 (file)
@@ -51,13 +51,6 @@ class InputTextElement extends AbstractFormElement
         $classes = array();
         $attributes = array();
 
-        if (!isset($config['checkbox'])) {
-            $config['checkbox'] = '0';
-            $checkboxIsset = false;
-        } else {
-            $checkboxIsset = true;
-        }
-
         // set all date times available
         $dateFormats = array(
             'date' => '%d-%m-%Y',
@@ -125,10 +118,6 @@ class InputTextElement extends AbstractFormElement
             $isDateField = true;
             $classes[] = 't3js-datetimepicker';
             $attributes['data-date-type'] = 'timesec';
-        } else {
-            if ($checkboxIsset === false) {
-                $config['checkbox'] = '';
-            }
         }
 
         // @todo: The whole eval handling is a mess and needs refactoring
@@ -158,8 +147,6 @@ class InputTextElement extends AbstractFormElement
             'field' => $parameterArray['itemFormElName'],
             'evalList' => implode(',', $evalList),
             'is_in' => trim($config['is_in']),
-            'checkbox' => ($config['checkbox'] ? 1 : 0),
-            'checkboxValue' => $config['checkbox'],
         );
         // set classes
         $classes[] = 'form-control';
index 9dd42f9..623e73d 100644 (file)
@@ -111,7 +111,6 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
        FormEngineValidation.initializeInputField = function(fieldName) {
                var $field = $('[name="' + fieldName + '"]');
                var $humanReadableField = $('[data-formengine-input-name="' + fieldName + '"]');
-               var $checkboxField = $('[name="' + fieldName + '_cb"]');
                var $mainField = $('[name="' + $field.data('main-field') + '"]');
                if ($mainField.length === 0) {
                        $mainField = $field;
@@ -122,22 +121,12 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                        var evalList = FormEngineValidation.trimExplode(',', config.evalList);
                        var value = $field.val();
 
-                       if (config.checkbox && value == config.checkboxValue) {
-                               $field.val('');
-                               if ($checkboxField.length) {
-                                       $checkboxField.attr('checked', '');
-                               }
-                       } else {
-                               for (var i = 0; i < evalList.length; i++) {
-                                       value = FormEngineValidation.formatValue(evalList[i], value, config)
-                               }
-                               // Prevent password fields to be overwritten with original value
-                               if (value.length && $humanReadableField.attr('type') != 'password') {
-                                       $humanReadableField.val(value);
-                               }
-                               if ($checkboxField.length) {
-                                       $checkboxField.attr('checked', 'checked');
-                               }
+                       for (var i = 0; i < evalList.length; i++) {
+                               value = FormEngineValidation.formatValue(evalList[i], value, config)
+                       }
+                       // Prevent password fields to be overwritten with original value
+                       if (value.length && $humanReadableField.attr('type') != 'password') {
+                               $humanReadableField.val(value);
                        }
                }
 
@@ -147,12 +136,6 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                        FormEngineValidation.updateInputField($(this).attr('data-formengine-input-name'));
                });
                $humanReadableField.on('keyup', FormEngineValidation.validate);
-
-               $checkboxField.data('main-field', fieldName);
-               $checkboxField.data('config', config);
-               $checkboxField.on('click', function() {
-                       FormEngineValidation.updateInputField($(this).attr('data-formengine-input-name'));
-               });
        };
 
        /**
@@ -197,9 +180,6 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                        case 'password':
                                theString = (value) ? FormEngineValidation.passwordDummy : '';
                                break;
-                       case 'int':
-                               theString = (config.checkbox && value == config.checkboxValue) ? '' : value;
-                               break;
                        default:
                                theString = value;
                }
index c0e207d..7991211 100644 (file)
@@ -1830,6 +1830,7 @@ class DataHandler
             $value = $GLOBALS['LANG']->csConvObj->substr($GLOBALS['LANG']->charSet, (string)$value, 0, (int)$tcaFieldConf['max']);
         }
         // Checking range of value:
+        // @todo: The "checkbox" option was removed for type=input, this check could be probably relaxed?
         if ($tcaFieldConf['range'] && $value != $tcaFieldConf['checkbox'] && (int)$value !== (int)$tcaFieldConf['default']) {
             if (isset($tcaFieldConf['range']['upper']) && (int)$value > (int)$tcaFieldConf['range']['upper']) {
                 $value = $tcaFieldConf['range']['upper'];
index 613784b..a569e25 100644 (file)
@@ -103,7 +103,6 @@ return array(
                 'type' => 'input',
                 'size' => '10',
                 'eval' => 'datetime',
-                'checkbox' => '0',
                 'default' => '0'
             )
         ),
@@ -115,7 +114,6 @@ return array(
                 'type' => 'input',
                 'size' => '8',
                 'eval' => 'datetime',
-                'checkbox' => '0',
                 'default' => '0',
                 'range' => array(
                     'upper' => mktime(0, 0, 0, 1, 1, 2038),
index 8b76c1d..b0a9d28 100644 (file)
@@ -94,7 +94,6 @@ return array(
                 'max' => '20',
                 'eval' => 'date',
                 'default' => '0',
-                'checkbox' => '0'
             )
         ),
         'endtime' => array(
@@ -105,7 +104,6 @@ return array(
                 'size' => '8',
                 'max' => '20',
                 'eval' => 'date',
-                'checkbox' => '0',
                 'default' => '0',
                 'range' => array(
                     'upper' => mktime(0, 0, 0, 1, 1, 2038),
index 3ba040c..e7cf8a2 100644 (file)
@@ -93,7 +93,6 @@ return array(
                 'max' => '20',
                 'eval' => 'date',
                 'default' => '0',
-                'checkbox' => '0'
             )
         ),
         'endtime' => array(
@@ -104,7 +103,6 @@ return array(
                 'size' => '8',
                 'max' => '20',
                 'eval' => 'date',
-                'checkbox' => '0',
                 'default' => '0',
                 'range' => array(
                     'upper' => mktime(0, 0, 0, 1, 1, 2038),
index f3a06e0..69c73fc 100644 (file)
@@ -141,7 +141,6 @@ return array(
                 'size' => '4',
                 'max' => '4',
                 'eval' => 'int',
-                'checkbox' => '0',
                 'range' => array(
                     'upper' => '1000',
                     'lower' => '10'
index 6e2cc87..3ee9569 100644 (file)
@@ -20,7 +20,6 @@ $TCA['tx_blogexample_domain_model_comment'] = array(
             'config' => array(
                 'type' => 'input',
                 'size' => 12,
-                'checkbox' => 1,
                 'eval' => 'datetime, required',
                 'default' => time()
             )
index aa81d89..8759805 100644 (file)
@@ -77,7 +77,6 @@ $TCA['tx_blogexample_domain_model_post'] = array(
             'config' => array(
                 'type' => 'input',
                 'size' => 12,
-                'checkbox' => 1,
                 'eval' => 'datetime, required',
                 'default' => time()
             )
index a0c81d6..124a907 100644 (file)
@@ -317,7 +317,6 @@ $tca = array(
                 'size' => 12,
                 'max' => 20,
                 'eval' => 'date',
-                'checkbox' => 1,
                 'default' => time()
             ),
         ),
@@ -331,7 +330,6 @@ $tca = array(
                 'size' => 12,
                 'max' => 20,
                 'eval' => 'date',
-                'checkbox' => 1,
                 'default' => time()
             ),
         ),
index a9403f7..839f6d3 100644 (file)
@@ -59,7 +59,6 @@ return array(
                 'type' => 'input',
                 'size' => 13,
                 'eval' => 'datetime',
-                'checkbox' => 0,
                 'default' => 0,
                 'range' => array(
                     'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
@@ -74,7 +73,6 @@ return array(
                 'type' => 'input',
                 'size' => 13,
                 'eval' => 'datetime',
-                'checkbox' => 0,
                 'default' => 0,
                 'range' => array(
                     'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
index c979547..26f25ad 100644 (file)
@@ -36,7 +36,6 @@ return array(
                 'max' => '20',
                 'eval' => 'date',
                 'default' => '0',
-                'checkbox' => '0'
             )
         ),
         'title' => array(
@@ -196,7 +195,6 @@ return array(
                 'size' => '12',
                 'eval' => 'datetime',
                 'default' => '0',
-                'checkbox' => '0'
             )
         ),
         'timer_offset' => array(
@@ -232,7 +230,6 @@ return array(
                 'max' => '20',
                 'eval' => 'int',
                 'default' => '0',
-                'checkbox' => '0'
             )
         ),
         'set_id' => array(
index 767ba20..c697dca 100644 (file)
@@ -32,8 +32,6 @@ class RsaInputElement extends AbstractFormElement
      */
     public function render()
     {
-        $languageService = $this->getLanguageService();
-
         $table = $this->data['tableName'];
         $fieldName = $this->data['fieldName'];
         $row = $this->data['databaseRow'];
index 394b397..207a5c0 100644 (file)
@@ -36,7 +36,6 @@ return array(
                 'max' => '20',
                 'eval' => 'date',
                 'default' => '0',
-                'checkbox' => '0'
             )
         ),
         'endtime' => array(
@@ -47,7 +46,6 @@ return array(
                 'size' => '8',
                 'max' => '20',
                 'eval' => 'date',
-                'checkbox' => '0',
                 'default' => '0',
                 'range' => array(
                     'upper' => mktime(0, 0, 0, 12, 31, 2020),
index 02722b9..36b7fa8 100644 (file)
@@ -102,7 +102,6 @@ return array(
                 'size' => '8',
                 'eval' => 'datetime',
                 'default' => '0',
-                'checkbox' => '0'
             )
         ),
         'unpublish_time' => array(
@@ -111,7 +110,6 @@ return array(
                 'type' => 'input',
                 'size' => '8',
                 'eval' => 'datetime',
-                'checkbox' => '0',
                 'default' => '0',
                 'range' => array(
                     'upper' => mktime(0, 0, 0, 12, 31, 2020)