Bug #81487
closedQuoting error for date field when building query in extbase repository
0%
Description
While migrating an extbase extension from 6.2 to 8.7 I noticed that the results from a custom repository query were very different (and wrong...) on T3 V8.7.
After debugging the query it turns out that the quoting for a field of type 'date' was wrong. The resulting SQL is now (T3 V8.7):
`tx_myext_domain_model_submissionslot`.`deadline` >= 2017
It actually should be (as it was in T3 V6.2):
`tx_myext_domain_model_submissionslot`.`deadline` >= '2017-06-06'
This will obviously generate wrong results.
The above WHERE clause was created by the following PHP code in the repository:
$query->greaterThanOrEqual('editions.submissionSlots.deadline', $start->format('Y-m-d'));
The TCA configuration for this field is:
'deadline' => array(
'exclude' => 1,
'label' => 'LLL:EXT:my_ext/Resources/Private/Language/locallang_db.xlf:tx_myext_domain_model_submissionslot.deadline',
'config' => array(
'dbType' => 'date',
'type' => 'input',
'renderType' => 'inputDateTime',
'size' => 10,
'eval' => 'date,required',
'checkbox' => 0,
'default' => '0000-00-00'
),
),
Updated by Morton Jonuschat over 7 years ago
- Is duplicate of Bug #79473: Typo3DbQueryParser fails since Doctrine by comparing date fields added
Updated by Morton Jonuschat over 7 years ago
- Related to Bug #81056: Query Builder fails on greater / less comparisons on string fields added
Updated by Gerrit Code Review over 7 years ago
- Status changed from Closed to Under Review
Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52802
Updated by Gerrit Code Review over 7 years ago
Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52802
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53244
Updated by Ian Solo over 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset 0bd1746384980d9f6f7387d8638d280443ee843b.