Bug #79925

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

Added by Ludwig Rafelsberger over 4 years ago. Updated about 1 year 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

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
#1

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51773

#2

Updated by Ludwig Rafelsberger over 4 years ago

  • Status changed from Under Review to New

Note: The patch is targeted against 7.6 because the data handling differs quite a lot in 8.x and from looking at the code I suspect that bug is already gone there (can't really test atm, sorry).

#3

Updated by Ludwig Rafelsberger over 4 years ago

  • Status changed from New to Under Review
#4

Updated by Ludwig Rafelsberger over 4 years ago

  • Status changed from Under Review to Closed
  • Priority changed from Should have to -- undefined --

With the release of TYPO3 CMS 8 LTS the TYPO3 CMS 7 has entered priority bugfix mode: https://typo3.org/typo3-cms/roadmap/

I assume this will no longer been taken care of?

#5

Updated by Christian Müller over 3 years ago

I've stumpled upon the same problem with TYPO3 7.6.23.
Is this closed 'cause someone thinks its priority is not high enough, and there is no chance this gets fixed for TYPO3 7.x?

#6

Updated by Franz Holzinger about 1 year ago

I have found a solution for TYPO3 9.5:

'crdate' => [
'exclude' => 1,
'label' => 'Creation Date',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,int',
'default' => 0
]
],
#7

Updated by Imko Schumacher 8 months ago

  • Copied to Bug #89914: Native date (TCA dbType) fields are not properly copied or localized added

Also available in: Atom PDF