Project

General

Profile

Actions

Bug #103703

closed

TYPO3 QueryBuilder does not allow all Doctrine DBAL types

Added by Daniel Siepmann 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Won't have this time
Assignee:
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2024-04-23
Due date:
% Done:

0%

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

Description

TYPO3 decorates the doctrine dbal QueryBuilder. This includes the createNamedParameter() method.
Doctrine DBAL supports the following types in v12.4: int|string|Type|null while TYPO3 only supports int.
TYPO3 main (13.x) supports ParameterType|ArrayParameterType while newest dbal 4.x supports string|ParameterType|Type|ArrayParameterType.

This leads to a situation that it seems impossible to provide a DateTimeImmutable instance and allow dbal to properly cast it to date which could be provided as string in v12 or DateType in main.
That comes in handy if using the native date/datetime/time fields introduced some time ago with TCA.

Is there a reason this is not supported by TYPO3?

Our example code with patched v12.4:

use TYPO3\CMS\Core\Database\Schema\Types\DateType;

$queryBuilder->where($queryBuilder->expr()->gte(
    'date.start',
    $queryBuilder->createNamedParameter($startAfter, new DateType())
));
Actions #1

Updated by Daniel Siepmann 7 months ago

  • Description updated (diff)
Actions #2

Updated by Daniel Siepmann 7 months ago

  • Description updated (diff)
Actions #3

Updated by Daniel Siepmann 7 months ago

  • Description updated (diff)
Actions #4

Updated by Stefan Bürk 7 months ago

  • Assignee set to Stefan Bürk
Actions #5

Updated by Stefan Bürk 7 months ago

Good point. Will have a look on this week. TBH cannot tell
currently why. Will also check related ethods with type
paremeters and handling codes around.

Actions #6

Updated by Daniel Siepmann 7 months ago

  • Description updated (diff)
Actions #7

Updated by Daniel Siepmann 7 months ago

  • Status changed from New to Closed
  • Priority changed from Should have to Won't have this time

We investigated once more and v13 already has this, so we don't need to backport to v12.

Actions

Also available in: Atom PDF