Project

General

Profile

Actions

Bug #87524

closed

lower range in datetime causes empty input fields

Added by David Aichinger over 5 years ago. Updated 10 months ago.

Status:
Closed
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 1 (0 open1 closed)

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

Actions
Actions #1

Updated by Josef Glatz about 5 years ago

  • Description updated (diff)
Actions #2

Updated by David Aichinger about 5 years ago

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

Actions #3

Updated by Riccardo De Contardi about 4 years 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

Actions #4

Updated by Georg Tiefenbrunn over 2 years 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
Actions #5

Updated by Georg Tiefenbrunn over 2 years 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

Actions #6

Updated by Nikita Hovratov over 2 years ago

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

Updated by Gerrit Code Review over 2 years 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

Actions #8

Updated by Gerrit Code Review over 2 years 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

Actions #9

Updated by Gerrit Code Review over 2 years 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

Actions #10

Updated by Gerrit Code Review over 2 years 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

Actions #11

Updated by Gerrit Code Review over 2 years 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

Actions #12

Updated by Gerrit Code Review over 2 years 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

Actions #13

Updated by Nikita Hovratov 10 months ago

  • Status changed from Under Review to Closed

Won't be fixed anymore for v10. Since TYPO3 v11 there is the flatpickr.

Actions

Also available in: Atom PDF