Project

General

Profile

Actions

Bug #92900

open

Unable to store "epoch start" on native datetime fields with dbtype

Added by Imko Schumacher over 3 years ago. Updated 10 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2020-11-21
Due date:
% Done:

100%

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

Description

The datetime input 00:00 01-01-1970 (special value - start of unix epoch, timestamp 0) gets saved as default value 0000-00-00 00:00:00.

Prerequisite

- testet on master(9ded7c21f126627b090b4f13715f03d3c57ebe30), 10.4.9 and seems to be present in older versions

TCA configuration:

'columns' => [
    'mydatetime' => [
        'config' => [
            'type' => 'input',
            'renderType' => 'inputDateTime',
            'dbType' => 'datetime',
            'eval' => 'datetime,null',
        ],
    ],
],

Steps to reproduce the problem

  • Input the following values in the backend record editor
    • 00:00 01-01-1970
  • Save the form

Actual results

Database:
  • 0000-00-00 00:00:00
    (Default value for datetime)

Expected results:

Database:
  • 1970-01-01 00:00:00

Additional notes

  • There was already some discussion on https://review.typo3.org/c/Packages/TYPO3.CMS/+/66670 , but got outsourced to here
  • Also influences time inputs (e.g. 00:00), however works out in the end
  • Problem location: DataHandler -> checkValueForInput
  • The input gets converted to a tiemstamp for the "sake of checks".
    In this case, the resulting timestamp is 0 and interpreted as false in the following checks (both need to be fixed)
if (isset($tcaFieldConf['dbType']) && isset($res['value']) && !$res['value']) {
    // set the value to null if we have an empty value for a native field
    $res['value'] = null;
}

$res['value'] = $res['value'] ? gmdate($format, $res['value']) : $emptyValue;

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #99847: Null value for time field is ignored in BEResolved2023-02-06

Actions
Actions #1

Updated by Riccardo De Contardi over 3 years ago

related to #91508 and #79448 ?

Actions #2

Updated by Imko Schumacher over 3 years ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review over 3 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 https://review.typo3.org/c/Packages/TYPO3.CMS/+/66904

Actions #4

Updated by Gerrit Code Review over 3 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/c/Packages/TYPO3.CMS/+/66904

Actions #5

Updated by Gerrit Code Review over 3 years ago

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

Actions #6

Updated by Gerrit Code Review over 3 years ago

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

Actions #7

Updated by Gerrit Code Review over 2 years ago

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

Actions #8

Updated by Gerrit Code Review over 2 years ago

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

Actions #9

Updated by Gerrit Code Review over 2 years ago

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

Actions #10

Updated by Gerrit Code Review over 2 years ago

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

Actions #11

Updated by Gerrit Code Review over 1 year ago

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

Actions #12

Updated by Gerrit Code Review over 1 year ago

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

Actions #13

Updated by Gerrit Code Review over 1 year ago

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

Actions #14

Updated by Gerrit Code Review about 1 year ago

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

Actions #15

Updated by Gerrit Code Review about 1 year ago

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

Actions #16

Updated by Gerrit Code Review about 1 year ago

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

Actions #17

Updated by JAKOTA Design Group GmbH about 1 year ago

  • Related to Bug #99847: Null value for time field is ignored in BE added
Actions #18

Updated by Gerrit Code Review 12 months ago

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

Actions #19

Updated by Gerrit Code Review 10 months ago

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

Actions #20

Updated by Gerrit Code Review 10 months ago

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

Actions #21

Updated by Gerrit Code Review 10 months ago

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

Actions #22

Updated by Gerrit Code Review 10 months ago

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

Actions #23

Updated by Gerrit Code Review 10 months ago

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

Actions #24

Updated by Gerrit Code Review 10 months ago

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

Actions #25

Updated by Gerrit Code Review 10 months ago

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

Actions #26

Updated by Gerrit Code Review 10 months ago

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

Actions #27

Updated by Gerrit Code Review 10 months ago

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

Actions #28

Updated by Gerrit Code Review 10 months ago

Patch set 1 for branch 12.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/+/79812

Actions #29

Updated by Imko Schumacher 10 months ago

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

Updated by JAKOTA Design Group GmbH 10 months ago

Hi, since this was reported for version 10.x. Wouldn't the patch also be a candidate for version 11?

Actions #31

Updated by Gerrit Code Review 10 months ago

  • Status changed from Resolved to Under Review

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

Actions #32

Updated by Gerrit Code Review 10 months ago

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

Actions #33

Updated by Gerrit Code Review 10 months ago

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

Actions #34

Updated by Gerrit Code Review 10 months ago

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

Actions #35

Updated by Gerrit Code Review 10 months ago

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

Actions #36

Updated by Gerrit Code Review 10 months ago

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

Actions #37

Updated by Gerrit Code Review 10 months ago

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

Actions

Also available in: Atom PDF