Skip to content

[BUG] Pending relations resolve command uses wrong DBAL result type #142

@ErHaWeb

Description

@ErHaWeb

Problem

The interest:pendingrelations --resolve command aborts before processing resolvable relations when running with TYPO3 13 and Doctrine DBAL 4.

The command imports Doctrine\DBAL\Driver\Result, but QueryBuilder->executeQuery() returns Doctrine\DBAL\Result.

Because of that, the runtime type check fails even though the query result is valid.

Steps to reproduce

  1. Have resolvable rows in tx_interest_pending_relations
  2. Run:
    typo3 interest:pendingrelations --resolve
  3. The command aborts with:
    Query result was not an instance of Doctrine\DBAL\Driver\Result
    

Expected behavior

The command should accept the executeQuery() result and continue resolving pending relations.

Suggested fix

Replace the imported type in Classes/Command/PendingRelationsCommandController.php:

use Doctrine\DBAL\Result;

instead of:

use Doctrine\DBAL\Driver\Result;

Reference

TYPO3 documents that QueryBuilder->executeQuery() returns a \Doctrine\DBAL\Result object:
https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/Database/DoctrineDbal/QueryBuilder/Index.html#database-query-builder-execute-query

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions