86302[BUGFIX] Properly evaluate EXT:indexed_search restriction by mediaType
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Oli Bartsch +1
-
Verified V +2 Done
- Benni Mack +2
- Oli Bartsch +1
- core-ci +1 CI
Issues 3
Files 2
Review log 2027
Show 12 earlier messages
-
Garvin Hicking uploaded patch set 1 09/24/24, 18:52
-
core-ci voted on patch set 1 V -1 09/24/24, 18:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66513
-
Garvin Hicking uploaded patch set 2
V -109/24/24, 19:22 -
core-ci voted on patch set 2 V +1 09/24/24, 19:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66519
-
Oli Bartsch commented on patch set 2 CR -1 09/24/24, 20:37
-#IndexSearchRepository.php:164This will lead to an undefined array access in case $searchData does not contain `mediaType`IndexSearchRepository.php:166Let's check whether $searchData['mediaType'] is actually string - not just typecasting.IndexSearchRepository.php:777Why do we no longer access $this->mediaType directly?IndexSearchRepository.php:793I'm really not a big fan of mocking. However, is there a chance we can have some test without this new method and without changing the method visibility of `mediaTypeWhere`?IndexSearchRepositoryTest.php:113Please add the data provider above the test method.IndexSearchRepositoryTest.php:170I don't think we need a extra method for the single use in the new test. -
Garvin Hicking uploaded patch set 3
CR -1V +109/25/24, 07:36address code review -
Garvin Hicking commented on patch set 3 09/25/24, 07:36
Reply
DoneIndexSearchRepository.php:164ReplyDoneIndexSearchRepository.php:166ReplyDoneIndexSearchRepository.php:777ReplyDue to the introduction of the getter for the method I wanted to rely on the getter, and not route through direct access. In case we may want to utilize the getter in the future some more.IndexSearchRepository.php:793ReplyI didn't see another possibility to make it accessible within a test. I did not want to utilize the Reflection API to dynamically change visibility just for the test, but that is IMO the only option to prevent the public access. My personal thought is, since the class is internal, and getting the mediatype plus getting the raw SQL is a thing that should be available. But I'm very open to any suggestion. I don't "love" this myself.IndexSearchRepositoryTest.php:113ReplyDoneIndexSearchRepositoryTest.php:170ReplyDone -
core-ci voted on patch set 3 V -1 09/25/24, 07:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66546
-
Garvin Hicking uploaded patch set 4
V -109/25/24, 09:23 -
core-ci voted on patch set 4 V +1 09/25/24, 09:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66561
-
Oli Bartsch commented on patch set 4 09/25/24, 10:15
IndexSearchRepository.php:793ReplyOke but do we really need the getter? I mean we test the correct mediaType via the `$searchRepository->mediaTypeWhere()` already, right? -
Garvin Hicking commented on patch set 4 09/25/24, 11:37
IndexSearchRepository.php:793ReplyIn my test I wanted to match the resolved Enum properly, because I do some crude stuff to the SQL evaluation of what mediaTypeWhere() returns. Especially, because if the code in mediaTypeWhere will contain an error, we cannot catch this. So IMO we do not to match the mediaTypeWhere variable with an expectation. -
Stefan Bürk commented on patch set 4 CR -1 09/26/24, 09:56
Will talk with garvin how to avoid making these public methods ... -
Garvin Hicking uploaded patch set 5
CR -1V +109/30/24, 10:09Adjust test to use closure -
Garvin Hicking commented on patch set 5 09/30/24, 10:13
Reply
DoneRefactored this with a closure bind to access the tested methods in the current scope, similar to the approach of https://review.typo3.org/c/Packages/TYPO3.CMS/+/86378 -
Garvin Hicking commented on patch set 5 09/30/24, 10:14
IndexSearchRepository.php:793ReplyDone -
core-ci voted on patch set 5 V +1 09/30/24, 10:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66849
-
Garvin Hicking uploaded patch set 6
V +109/30/24, 16:42Change from closure to reflection like in other patch -
Garvin Hicking commented on patch set 6 09/30/24, 16:42
I've now realigned this with the same approach as in https://review.typo3.org/c/Packages/TYPO3.CMS/+/86382 using reflection. -
Garvin Hicking commented on patch set 6 09/30/24, 16:43
Reply
Wrong link, I meant https://review.typo3.org/c/Packages/TYPO3.CMS/+/86378 -
core-ci voted on patch set 6 V +1 09/30/24, 16:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66859
-
Stefan Bürk voted on patch set 6 CR +1 V +1 10/14/24, 08:24
-
Oli Bartsch uploaded patch set 7
CR +1V +110/14/24, 18:48 -
Oli Bartsch voted on patch set 7 CR +1 V +1 10/14/24, 18:48
-
core-ci voted on patch set 7 V +1 10/14/24, 18:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67776
-
Benni Mack voted on patch set 7 CR +2 V +2 10/15/24, 05:19
-
Benni Mack merged patch set 8 10/15/24, 05:19