Bug #87524

lower range in datetime causes empty input fields

Added by David Aichinger almost 3 years ago. Updated about 22 hours ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2019-01-23
Due date:
% Done:

0%

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

Description

When i open records which have date fields that are lower than defined in the range, the input field gets emptied instead of just showing that a validator is violated.

Here my TCA config

'starttime' => array(
    'exclude' => 1,
    'l10n_mode' => 'mergeIfNotBlank',
    'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
    'config' => array(
            'type' => 'input',
        'size' => 13,
        'max' => 20,
        'eval' => 'datetime,required',
        'checkbox' => 0,
        'default' => 0,
        'range' => array(
            'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
        ),
    ),
),

Related issues

Related to TYPO3 Core - Bug #94647: TCAdefaults are ignored for inputDateTime fields if lower range lies in futureUnder Review2021-07-27

Actions
#1

Updated by Josef Glatz almost 3 years ago

  • Description updated (diff)
#2

Updated by David Aichinger almost 3 years ago

Additional Info: I updated from 8.7.22 to 8.7.24. This behaviour wasn't there in 8.7.22

#3

Updated by Riccardo De Contardi over 1 year ago

I tried with 9.5.15 and

        'eval' => 'datetime,required',
        'range' => array(
            'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
        ),

(BTW: what should 'checkbox' => 0, do?)

and I found that

- the "required" validation seems to work, but it does not say that the field is required
- the datepicker does not let me select a date prior than the current date (today)
- if I try to write a date in the past (yesterday), when saved it is reverted to today

#4

Updated by Georg Tiefenbrunn 4 months ago

  • Subject changed from 8.7.24 lower range in datetime causes empty input fields to lower range in datetime causes empty input fields

Still present in TYPO3 10.4.18

  • Invalid (outdated) valued are first rendered inside the form element and are stored in the hidden input fields but get cleared by JavaScript.
  • "required" validation is not executed, the field is not marked as error
#5

Updated by Georg Tiefenbrunn 4 months ago

the field is not marked as error

value is not transformed to integer in JS function FormEngineValidation.validateField() and thus the condition if (!isNaN(minValue) && value < minValue) will never match for date/dateTime strings.

https://github.com/TYPO3/typo3/blob/10.4/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js#L304

#6

Updated by Nikita Hovratov 4 months ago

  • Related to Bug #94647: TCAdefaults are ignored for inputDateTime fields if lower range lies in future added
#7

Updated by Gerrit Code Review 4 months ago

  • Status changed from New to Under Review

Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70167

#8

Updated by Gerrit Code Review 4 months ago

Patch set 4 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70167

#9

Updated by Gerrit Code Review 4 months ago

Patch set 5 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70167

#10

Updated by Gerrit Code Review 4 months ago

Patch set 6 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70167

#11

Updated by Gerrit Code Review about 2 months ago

Patch set 7 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70167

#12

Updated by Gerrit Code Review about 22 hours ago

Patch set 8 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70167

Also available in: Atom PDF