Review main Merged

76890[BUGFIX] Avoid invalid orderBy for count query in EXT:reactions

Georg Ringer CR +2 V +2 Easy +15 −14 updated 12/05/22, 06:49

Commit message

Avoid an exception if using PostgreSQL because there
must not be a orderBy part if building a count query.
PostgreSQL is here quite strict.

Additionally, ensuring determinisic ordering is done
a long the way as a side change.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1417

  1. Georg Ringer uploaded patch set 1 12/02/22, 15:21

  2. Georg Ringer commented on patch set 1 12/02/22, 15:21

    This change is ready for review.
  3. core-ci voted on patch set 1 V +1 12/02/22, 15:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34573

  4. Stefan Bürk voted on patch set 1 V +1 CR +1 12/02/22, 15:36

  5. Oliver Klee voted on patch set 1 CR +1 12/02/22, 15:52

  6. Oli Bartsch commented on patch set 1 12/02/22, 17:56

    ReactionRepository.php:49

    This looks a bit strange since it requires internal knowledge of the method. I'm in favour of either not adding the orderBy part at all or to make it configurable in the methods signature (bool $addDefaultOrderByClause = true).
  7. Stefan Bürk commented on patch set 1 V 0 CR -1 12/03/22, 23:11

    on it ...

    ReactionRepository.php:49 Reply

    I guess, this has been adopted from other places. It's more the logic to have one place where the query is build, eventually based on parameters (aka demand etc). and then simply switch to count(*) ... the `resetQueryPart()` is therefor needed to ensure that there is no ordering set. However, what is really confusing in this repository implementation is the fact the the `select()` and `from()` is redone after fetching the generic one ... which basicly made the getQueryBuilder() kind of superflous (not really). I think, your suggestion suits here quite well and avoid that here. I guess, this cannot be done in every case, but here it is a good approach - so long it is respected and not changed. It would be a "save-guard" to have it here. And, it should be ensured that determinisitc ordering is ensured - which is not the fact currently.
  8. Stefan Bürk uploaded patch set 2 CR +1 V +1 12/03/22, 23:22

  9. Stefan Bürk commented on patch set 2 12/03/22, 23:28

    ReactionRepository.php:49 Reply

    Done
  10. core-ci voted on patch set 2 V +1 12/03/22, 23:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34598

  11. Stefan Bürk voted on patch set 2 V +1 CR +1 12/03/22, 23:30

  12. Georg Ringer voted on patch set 2 V +1 CR +1 12/04/22, 09:45

  13. Stefan Bürk updated the commit message in patch set 3 CR +1 V +1 12/04/22, 18:12

  14. Stefan Bürk voted on patch set 3 V +1 CR +1 12/04/22, 18:13

  15. core-ci voted on patch set 3 V +1 12/04/22, 18:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34609

  16. Georg Ringer voted on patch set 3 V +2 CR +2 12/05/22, 06:49

  17. Georg Ringer merged patch set 4 12/05/22, 06:49