Bug #25111
closedCleanup: Remove obsolete checkbox code for input fields
100%
Description
Since version 4.5 the "checkbox" configuration for columns of type "input" is obsolete. Every input field now has a clear button within the field and input fields with date/time values automatically get a date picker.
The code for the checkboxes hasn't been removed completely but is not used any more.
Solution: Remove all obsolete code and output a deprecation warning if someone uses the configuration option "checkbox" for columns of type "input".
Related information:
http://forge.typo3.org/issues/23742 (The original RFC that replaced the checkbox)
http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.3.0/view/4/2/#id2520906 (TCA Reference for columns of type "input")
http://forge.typo3.org/issues/13137 (issue for updating the "checkbox" configuration in TCA Reference)
(issue imported from #M17680)
Files
Updated by Alexander Opitz over 9 years ago
- Status changed from New to Needs Feedback
- Is Regression set to No
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.4)?
Updated by Alexander Stehlik over 9 years ago
As it looks to me there is still a logical error in the code:
In the beginning of FormEngine->getSingleField_typeInput()
you can find:
if (!isset($config['checkbox'])) { $config['checkbox'] = '0'; $checkboxIsset = FALSE; } else { $checkboxIsset = TRUE; }
So if the user did not define checkbox in his TCA, it is defined from now on (isset()
will return TRUE
).
A few lines later the validation settings are validated and if nothing is configured there this code is executed:
} else { $inputId = uniqid('tceforms-textfield-'); $cssClasses[] = 'tceforms-textfield'; if ($checkboxIsset === FALSE) { $config['checkbox'] = ''; } }
Again, $config['checkbox']
will be set to an empty string (FALSE
) but not to NULL
.
But finally it will not be evaluated if $config['checkbox'] is TRUE but if it isset()
in two places:
$paramsList = '\'' . $PA['itemFormElName'] . '\',\'' . implode(',', $evalList) . '\',\'' . trim($config['is_in']) . '\',' . (isset($config['checkbox']) ? 1 : 0) . ',\'' . $config['checkbox'] . '\'';
and
if (isset($config['checkbox'])) { $item .= IconUtility::getSpriteIcon('actions-input-clear', array('tag' => 'a', 'class' => 't3-tceforms-input-clearer', 'onclick' => 'document.getElementById(\'' . $inputId . '\').value=\'\';document.getElementById(\'' . $inputId . '\').focus();' . implode('', $PA['fieldChangeFunc']))); }
So basically currently the checkbox (clear button) is always rendered no matter what the user configured because $config['checkbox']
is always NOT NULL
but TRUE
or FALSE
.
This is why I would vote for getting rid of the setting.
Updated by Alexander Opitz over 9 years ago
- Category set to Backend User Interface
- Status changed from Needs Feedback to New
Sounds argl :D
Updated by Gerrit Code Review over 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/44129
Updated by Gerrit Code Review over 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44129
Updated by Christian Kuhn over 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 3acc0f45f4fc8395a6a2a62642c5efd8fdb7f114.