Review main Abandoned

82502[TASK] Mitigate deprecated `QueryBuilder::add()` method calls

Stefan Bürk CR 0 V 0 Easy +17 −22 updated 01/17/24, 20:39

Commit message

Doctrine DBAL deprecated a handful QueryBuilder methods without
a replacement. One of them is the `add()` method to set or append
a specified query part. This method will be removed with Doctrine
DBAL 4.0.x [1]. The removal aligns to the decision to make the
internal state not accessible, like the also deprecated and
related methods `resetQueryParts()`, `resetQueryPart()`,
`getQueryParts()` and `getQueryPart()`.

This change modifies user-land code to

* Replace `QueryBuilder->add('select', . , false)` with
  `QueryBuilder->getConcreateQueryBuilder()->select()`

* Replace `QueryBuilder->add('select', . , true)` with
  `QueryBuilder->getConcreateQueryBuilder()->addSelect()`

* Replace `QueryBuilder->add('orderBy', . , false)` with
  QueryBuilder->getConcreateQueryBuilder()->orderBy()

* Replace `QueryBuilder->add('orderBy', . , true)` with
  `QueryBuilder->getConcreateQueryBuilder()->addOrderBy()`

[1] https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-changes-in-the-querybuilder-api

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 6

Review log 35

  1. Stefan Bürk uploaded patch set 1 01/17/24, 19:12

  2. Benni Mack updated the commit message in patch set 2 01/17/24, 19:18

  3. core-ci voted on patch set 1 V -1 01/17/24, 19:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51713

  4. core-ci voted on patch set 2 V -1 01/17/24, 19:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51714

  5. Stefan Bürk abandoned the change 01/17/24, 20:39

    Extracting as pre-patch not working - would need to much intermediate code. Modify usage with removal of function add in one patch.