Project

General

Profile

Actions

Bug #79925

closed

Native date/datetime (TCA dbType) fields are not properly copied or localized

Added by Ludwig Rafelsberger almost 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
-- undefined --
Category:
-
Target version:
Start date:
2017-02-20
Due date:
% Done:

0%

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

Description

Suppose you have a record that contain a field which is configured like so:

  'type' => 'input',
  'eval' => 'datetime',
  'dbType' => 'datetime',

Then, copying or localizing this record leads to the date 1970-01-01 (i.e. the begin of the UNIX epoch) being inserted in the copy/localization instead of the related date from the source record.


How to reproduce:

  • Install the attached minimal demo extension (or use any other record which contains native date/datetime fields)
  • Create such a new record (or use an existing one)
  • Copy it
  • Paste it

Expected result:

  select * from tx_reproducedbtypebug_foo;

  uid   pid     some_int_based_tstamp    some_native_dbtype_field
  1     1       1487548800               2017-02-20 00:00:00
  2     1       1487548800               2017-02-20 00:00:00      <-- the copied record as it should be

Actual result:

  select * from tx_reproducedbtypebug_foo;

  uid   pid     some_int_based_tstamp    some_native_dbtype_field
  1     1       1487548800               2017-02-20 00:00:00
  2     1       1487548800               1970-01-01 01:33:37      <-- the copied record with wrong date

Files

reproduce_dbtype_bug.zip (3.91 KB) reproduce_dbtype_bug.zip Ludwig Rafelsberger, 2017-02-20 17:42

Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #79613: Saving wrong Date into DB if Field is of type DATENew2017-02-03

Actions
Copied to TYPO3 Core - Bug #89914: Native date (TCA dbType) fields are not properly copied or localizedClosed2019-12-11

Actions
Actions

Also available in: Atom PDF