Project

General

Profile

Actions

Bug #25111

closed

Cleanup: Remove obsolete checkbox code for input fields

Added by Alexander Stehlik about 13 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2011-02-20
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

typo3-17680b-remove_checkbox.diff (6.13 KB) typo3-17680b-remove_checkbox.diff Administrator Admin, 2011-02-20 14:02
Actions #1

Updated by Chris topher almost 13 years ago

  • Target version deleted (0)
Actions #2

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)?

Actions #3

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.

Actions #4

Updated by Alexander Opitz over 9 years ago

  • Category set to Backend User Interface
  • Status changed from Needs Feedback to New

Sounds argl :D

Actions #5

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

Actions #6

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

Actions #7

Updated by Christian Kuhn over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF