Review main Merged

81091[TASK] Move DB related code of EXT:indexed_search to the repository

Georg Ringer CR +2 V +2 Normal +80 −81 updated 09/28/23, 12:29

Commit message

Make the controller a bit more slim by moving
database related code to the repository.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Oliver Klee +1
    • Stefan Bürk +1
    • Jörg Bösche +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1723

  1. Georg Ringer uploaded patch set 1 09/19/23, 21:32

  2. Georg Ringer commented on patch set 1 09/19/23, 21:32

    This change is ready for review.
  3. core-ci voted on patch set 1 V -1 09/19/23, 21:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46833

  4. Georg Ringer uploaded patch set 2 V -1 09/19/23, 21:54

  5. core-ci voted on patch set 2 V +1 09/19/23, 22:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46834

  6. Benni Mack voted on patch set 2 CR +1 09/20/23, 09:25

  7. Christian Kuhn updated the commit message in patch set 3 CR +1 V +1 09/20/23, 10:11

  8. Christian Kuhn voted on patch set 3 V +1 CR +1 09/20/23, 10:11

  9. core-ci voted on patch set 3 V +1 09/20/23, 10:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46870

  10. Andreas Kienast commented on patch set 3 09/20/23, 11:51

    IndexSearchRepository.php:292

    Can you please add the return type?

    IndexSearchRepository.php:308

    Can you please add the return type?
  11. Georg Ringer uploaded patch set 4 CR +1 V +1 09/20/23, 12:23

  12. core-ci voted on patch set 4 V +1 09/20/23, 12:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46881

  13. Stefan Bürk commented on patch set 4 CR -1 09/20/23, 19:34

    SearchController.php:298

    Return type should be adjusted and here a check for false or null is needed, depending on return type in the method. See comment for the method in the SearchRepository. It was wrong not to deal with "false" before hand.

    SearchController.php:722

    Return type should be adjusted and here a check for false or null is needed, depending on return type in the method. See comment for the method in the SearchRepository. It was wrong not to deal with "false" before hand.

    IndexSearchRepository.php:292 Reply

    see other comment, should be array|null or array|false

    IndexSearchRepository.php:295

    The array cast feels to be wrong. The return type should be `array|null` or `?array` and than using ``` ->fetchAssociative() ?: null ``` or simply adopt the `array|false` return type.

    IndexSearchRepository.php:305

    If only one record is retrieved, a limit(1) should be used. That ensures that at all costs the buffer is cleared. Otherwise it may or may not lead to issues. Therefore, it's good to free the buffer by either retrieving all results, free it forcefully or ensure by using a limit that no unread data is in the buffer. Granted, the simply moved - but let's make that clean here now.

    IndexSearchRepository.php:308 Reply

    see other comment, should be array|null or array|false

    IndexSearchRepository.php:308

    Same here: The array cast feels to be wrong. The return type should be `array|null` or `?array` and than using ``` ->fetchAssociative() ?: null ``` or simply adopt the `array|false` return type.

    IndexSearchRepository.php:322

    If only one record is retrieved, a limit(1) should be used. That ensures that at all costs the buffer is cleared. Otherwise it may or may not lead to issues. Therefore, it's good to free the buffer by either retrieving all results, free it forcefully or ensure by using a limit that no unread data is in the buffer. Granted, the simply moved - but let's make that clean here now.
  14. Georg Ringer uploaded patch set 5 CR -1 V +1 09/21/23, 05:49

  15. core-ci voted on patch set 5 V +1 09/21/23, 05:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46964

  16. Oliver Klee commented on patch set 5 09/21/23, 07:32

    SearchController.php:298 Reply

    Done

    SearchController.php:299

    Let's be explicit here (as the variable is not always a boolean): ```php if (is_array($indexCfgRec)) { ```
  17. Stefan Bürk uploaded patch set 6 V +1 09/22/23, 16:24

  18. Stefan Bürk commented on patch set 6 V +1 CR +1 09/22/23, 16:24

    SearchController.php:299 Reply

    Done

    SearchController.php:722 Reply

    Done

    IndexSearchRepository.php:292 Reply

    Done

    IndexSearchRepository.php:295 Reply

    Done

    IndexSearchRepository.php:305 Reply

    Done

    IndexSearchRepository.php:308 Reply

    Done

    IndexSearchRepository.php:308 Reply

    Done

    IndexSearchRepository.php:322 Reply

    Done
  19. core-ci voted on patch set 6 V +1 09/22/23, 16:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47095

  20. Oliver Klee voted on patch set 6 CR +1 09/22/23, 17:18

  21. Jörg Bösche voted on patch set 6 CR +1 09/28/23, 11:07

  22. Georg Ringer voted on patch set 6 V +2 CR +2 09/28/23, 12:29

  23. Georg Ringer merged patch set 7 09/28/23, 12:29