94130[TASK] Throw exception if UriBuilder misses ContentObjectRenderer
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Simon Schaufelberger +1
-
Verified V +2 Done
- Benni Mack +2
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 1
Review log 1619
-
Markus Klein uploaded patch set 1 05/22/26, 10:47
-
core-ci voted on patch set 1 V -1 05/22/26, 10:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102350
-
Markus Klein commented on patch set 2
V -105/22/26, 14:06Published edit on patch set 1. -
core-ci voted on patch set 2 V +1 05/22/26, 14:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102357
-
Simon Schaufelberger voted on patch set 2 CR +1 V +1 05/22/26, 17:51
-
Oliver Klee voted on patch set 2 CR +1 05/22/26, 19:50
-
Oliver Klee voted on patch set 2 CR 0 05/22/26, 19:50
-
Oliver Klee commented on patch set 2 05/22/26, 19:52
Would it make sense to cover this with a test?UriBuilder.php:524`$currentContentObject` isn't a boolean, and we should not use a boolean operation on it. Instead, let's do one of those: ```suggestion if (!($currentContentObject instanceof ContentObjectRenderer)) { ``` or ```suggestion if ($currentContentObject === null) { ``` -
Markus Klein commented on patch set 2 05/23/26, 08:42
UriBuilder.php:524ReplyI do not have a hard opinion on that. I'm from the C/asm-era, where everything is a number and can be non-zero ;-) Since we can only get `null` or a valid object, a negation operator is totally fine for me and explicit enough. (I'm aware that PHPSTAN has some very opinionated rules about that in their strict-line, but for my personal taste a simple and straight `!` is more pleasant to read than longer `=== null` stuff.) If I'd need to choose though, I'd go with checking the error-case, which is the `null`. So feel free to adjust, if you deem it necessary. -
Markus Klein commented on patch set 2 05/23/26, 08:44
Reply
Feel free to add one. I did not take the time for this simple sanity check. -
Oliver Klee commented on patch set 2 05/23/26, 09:36
Reply
I don't know how to reproduce the conditions leading to the exception. Do you have any code to reproduce this? -
Markus Klein commented on patch set 2 05/23/26, 11:05
Reply
use a getter of an Extbase model, that uses an UriBuilder and sets the global TYPO3_REQUEST on the uribuilder. this request lacks the cObj and therefore silently fails and returns an empty url -
Oliver Klee wrote 05/23/26, 12:27
Removed reviewer Oliver Klee. -
Markus Klein updated the commit message in patch set 3
CR +1V +109/30/26, 12:53 -
core-ci voted on patch set 3 V +1 09/30/26, 13:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109629
-
Simon Schaufelberger voted on patch set 3 CR +1 V +1 09/30/26, 21:03
-
Benni Mack voted on patch set 3 CR +2 V +2 09/30/26, 21:28
-
Benni Mack merged patch set 4 09/30/26, 21:28