Project

General

Profile

Actions

Bug #28298

closed

TCE form field with range cannot be cleared in some cases

Added by Jigal van Hemert over 13 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2011-07-18
Due date:
% Done:

100%

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

Description

After removing the TCA 'checkbox' option (the weird checkbox that cleared the field and could set the default value in it) and adding a clear icon inside the field to remove the contents, it is not possible to clear a (date) field which has a lower limit other than zero if the TCA definition of the field still has 'checkbox' => '0' (for backward compatibility).

The reason is a bit complex. The old 'checkbox' put the value of the checkbox property into the field. So, 'checkbox' => '0' would fill the field with '0' if the checkbox was unchecked.
The new clear icon just clears the input field and effectively fills it with an empty string value.

In t3lib_TCEmain::checkValue_input() there is a check:
if
'range' property is set
AND
new value != 'checkbox' value
AND
new value != 'default' value
then make sure value is inside range.
If both 'checkbox' => '0', 'default' => '0' are set you could -- in older versions -- clear the date field with the checkbox and this '0' value would prevent the range to take effect.
In the new situation the new value is '' if you clear the field. ('' != '0') gives TRUE for both the checkbox and the default property and thus activates the range check.

This effect can be seen in the tt_news records. Set the end-date field, save, clear the field, save, now the lower limit of the range property is inserted.

I don't see a quick solution with the loose comparison behaviour of PHP: http://www.php.net/manual/en/types.comparisons.php


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #26503: Endtime cannot be removedClosed2011-04-29

Actions
Actions #1

Updated by Gerrit Code Review almost 13 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7624

Actions #2

Updated by Gerrit Code Review almost 13 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7624

Actions #3

Updated by Gerrit Code Review almost 13 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/8959

Actions #4

Updated by Gerrit Code Review almost 13 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/8960

Actions #5

Updated by Anonymous almost 13 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF