Bug #94647

TCAdefaults are ignored for inputDateTime fields if lower range lies in future

Added by Georg Tiefenbrunn about 2 months ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2021-07-27
Due date:
% Done:

0%

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

Description

TYPO3 10.4.18 (composer)

# TCA
table
  columns
    test_date
      config
        eval = date
        range
          lower = {value greater than now}
        renderType = inputDateTime
        type = input

# TCAdefaults
TCAdefaults.table.test_date = {future date}

On creating new records:

  • OK: range.lower is not set -> TCAdefaults is used
  • OK: range.lower is smaller than now() -> TCAdefaults is used
  • ERROR: range.lower is greater than now() (is a future date) -> TCAdefaults are ignored and range.lower is used as element value.

Related issues

Related to TYPO3 Core - Bug #91777: Date input fields always reset to lowest range when definedUnder Review2020-07-09

Actions
Related to TYPO3 Core - Bug #87524: lower range in datetime causes empty input fieldsUnder Review2019-01-23

Actions
#1

Updated by Nikita Hovratov about 2 months ago

Is the range.lower value less than the TCAdefaults value in your example?

#2

Updated by Georg Tiefenbrunn about 2 months ago

Nikita Hovratov wrote in #note-1:

Is the range.lower value less than the TCAdefaults value in your example?

Yes.

I initially defined range.lower, range.upper and TCAdefaults:

now = 2021-07-28 16:00:00
range.lower = 2021-07-29 (tomorrow)
range.upper = 2022-07-29 (+1 year)
TCAdefaults = 2022-07-29 (+1 year)

To narrow down the error I removed range.upper:

now = 2021-07-28 16:00:00
range.lower = 2021-07-29 00:00:00 (tomorrow; defined as INT)
TCAdefaults = 2022-07-29 (+1 year; set as STRING; see @eval = date@)

As long range.lower is less than now (range.lower = 2021-07-28 15:59:59) TCAdefaults are applied.
If range.lower is greater than now (range.lower = 2021-07-28 16:00:01; I didn't check if it's > or >=) TCAdefaults are ignored.

#3

Updated by Nikita Hovratov about 2 months ago

  • Related to Bug #91777: Date input fields always reset to lowest range when defined added
#4

Updated by Gerrit Code Review about 2 months ago

  • Status changed from New to Under Review

Patch set 1 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

#5

Updated by Nikita Hovratov about 2 months ago

The culprit was the bootstrap datetime picker in the end. What a ride of debugging :)

#6

Updated by Gerrit Code Review about 2 months ago

Patch set 2 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

#7

Updated by Nikita Hovratov about 2 months ago

  • Related to Bug #87524: lower range in datetime causes empty input fields added
#8

Updated by Gerrit Code Review about 2 months ago

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

#9

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

#10

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

#11

Updated by Gerrit Code Review about 1 month 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

Also available in: Atom PDF