Actions
Bug #81487
closedQuoting error for date field when building query in extbase repository
Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2017-06-06
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
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'
),
),
Actions