Project

General

Profile

Actions

Bug #81719

closed

Epic #77562: Misbehaviors with datetime values and timezones

DateTime comparisons not possible in 8.7

Added by Uwe Michelfelder over 7 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2017-06-27
Due date:
% Done:

0%

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

Description

Comparison based custom queries on DateTime values do not work anymore, because they do not get converted correctly in the Typo3DbQueryParser-> createTypedNamedParameter function.

There in line 501

$plainValue = $this->dataMapper->getPlainValue($value);

The value gets always converted to a Unix Timestamp, although in our case DateTime is used in the database and TCA.

The reason for this is, that in the getPlainValue method of the DataMapper, the second parameter "columnMap" is needed to convert the DateTime values to a string correctly.

Is related to #79473


Related issues 1 (1 open0 closed)

Is duplicate of TYPO3 Core - Bug #79473: Typo3DbQueryParser fails since Doctrine by comparing date fieldsNew2017-01-26

Actions
Actions #1

Updated by Riccardo De Contardi over 7 years ago

  • Related to Bug #79473: Typo3DbQueryParser fails since Doctrine by comparing date fields added
Actions #2

Updated by Georg Ringer over 7 years ago

closed as duplicate. already solved.

Actions #3

Updated by Georg Ringer over 7 years ago

  • Status changed from New to Closed
Actions #4

Updated by Uwe Michelfelder over 7 years ago

Georg Ringer wrote:

closed as duplicate. already solved.

Hi Georg,

I don't see, that the actual type ot the date is taken in account in the latest version.

https://github.com/TYPO3/TYPO3.CMS/blob/0bd1746384980d9f6f7387d8638d280443ee843b/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php

In line 414 and following there is still no "columnMap" as second parameter provided to the createTypedNamedParameter method:

case QueryInterface::OPERATOR_EQUAL_TO:
                if ($value === null) {
                    $expr = $fieldName . ' IS NULL';
                } else {
                    $placeHolder = $this->createTypedNamedParameter($value);
                    $expr = $exprBuilder->comparison($fieldName, $exprBuilder::EQ, $placeHolder);
                }
                break;

If the value is of type DateTime it still gets converted to a unixttimestamp (as a fallback) by createTypedNamedParameter method.
So in my eyes, this bug is not resolved an due to this, DateTime Values cannot be used straigt forward in the database and the extbase repositories methods.

All best,
Uwe

Actions #5

Updated by Georg Ringer over 7 years ago

  • Status changed from Closed to Accepted
Actions #6

Updated by Riccardo De Contardi over 7 years ago

  • Parent task set to #77562
Actions #7

Updated by Gerrit Code Review almost 6 years ago

  • Status changed from Accepted 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/58950

Actions #8

Updated by Gerrit Code Review almost 6 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/58950

Actions #9

Updated by Gerrit Code Review almost 6 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/58950

Actions #10

Updated by Gerrit Code Review almost 6 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/58950

Actions #11

Updated by Gerrit Code Review almost 6 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/58950

Actions #12

Updated by Benni Mack about 5 years ago

  • Status changed from Under Review to New
Actions #13

Updated by Christian Eßl over 4 years ago

  • Category set to Extbase
Actions #14

Updated by Markus Klein over 1 year ago

  • Related to deleted (Bug #79473: Typo3DbQueryParser fails since Doctrine by comparing date fields)
Actions #15

Updated by Markus Klein over 1 year ago

  • Is duplicate of Bug #79473: Typo3DbQueryParser fails since Doctrine by comparing date fields added
Actions #16

Updated by Markus Klein over 1 year ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF