Project

General

Profile

Actions

Bug #81487

closed

Quoting error for date field when building query in extbase repository

Added by Michael Stopp over 7 years ago. Updated about 6 years ago.

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'
  ),
),

Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #81056: Query Builder fails on greater / less comparisons on string fieldsClosed2017-04-28

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

Actions
Actions #1

Updated by Morton Jonuschat over 7 years ago

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

Updated by Morton Jonuschat over 7 years ago

  • Related to Bug #81056: Query Builder fails on greater / less comparisons on string fields added
Actions #3

Updated by Morton Jonuschat over 7 years ago

  • Status changed from New to Closed

Duplicates #79473

Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

Updated by Ian Solo over 7 years ago

  • Status changed from Under Review to Resolved
Actions #8

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF