80812[BUGFIX] Respect crop of FileReference objects in getImgResource
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Nikita Hovratov +1
-
Verified V +2 Done
- Stefan Bürk +2
- Oliver Klee +1
- Nikita Hovratov +1
- core-ci +1 CI
Issues 1
Files 3
Review log 1823
-
Friedemann Altrock uploaded patch set 1 08/31/23, 14:24
-
core-ci voted on patch set 1 V +1 08/31/23, 14:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46108
-
Friedemann Altrock updated the commit message in patch set 2
V +108/31/23, 14:51 -
core-ci voted on patch set 2 V +1 08/31/23, 14:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46110
-
Oliver Klee commented on patch set 2 08/31/23, 15:34
Can we cover this with a regression test? -
Benjamin Franzke uploaded patch set 3
V +109/01/23, 05:54 -
Benjamin Franzke commented on patch set 3 09/01/23, 05:54
Reply
Done -
Benjamin Franzke uploaded patch set 4
CR +1V +109/01/23, 05:58 -
core-ci voted on patch set 3 V +1 09/01/23, 06:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46123
-
core-ci voted on patch set 4 V +1 09/01/23, 06:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46124
-
Friedemann Altrock commented on patch set 4 09/01/23, 07:59
Reply
Somebody got up early ;) -
Nikita Hovratov uploaded patch set 5
CR +1V +109/01/23, 08:16 -
Nikita Hovratov voted on patch set 5 V +1 CR +1 09/01/23, 08:17
-
core-ci voted on patch set 5 V +1 09/01/23, 08:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46126
-
Benjamin Franzke commented on patch set 5 09/01/23, 08:25
ContentObjectRenderer.php:3715@Nikita: I don't have a strong opinion here, but `!== null` is/was sufficient here (all code paths that assigned to `$fileReference` actually returned a `FileReference`) and is slightly (but only very slightly, so it probably doesn't matter) faster. See https://gist.github.com/KVytyagov/57509333daaac69eb980777c7d28ea18 but with `instanceof` it looks like we could think of a possibility that `$fileReference` is referencing another type, not just `null`. What do you think? -
Nikita Hovratov commented on patch set 5 09/01/23, 08:38
ContentObjectRenderer.php:3715ReplyTechnically you are right. I changed it only in favor of better code readability. Less cognitive load for a "truthy" comparison instead of "is not". Also it is more robust against future code changes / refactoring. -
Friedemann Altrock commented on patch set 5 09/01/23, 08:42
ContentObjectRenderer.php:3715ReplyMy 2 cents: I don't see the !== null in any branch. (?) I see isset($fileReference). -> is GH outdated? https://github.com/TYPO3/typo3/blob/0baf11c8f697c5d9c29c4677331f96498af137c9/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L3713C25-L3713C25 -
Nikita Hovratov commented on patch set 5 09/01/23, 08:46
ContentObjectRenderer.php:3715ReplyWe changed it here to !== null from isset($fileReference) -
Oliver Klee commented on patch set 5 09/01/23, 08:51
ContentObjectRenderer.php:3715ReplyYep, cognitive load it is, and also it makes the type more specific for static analysis (the latter in many cases, but not all). In general, I hence recommend using instanceof instead of !== null. -
Oliver Klee voted on patch set 5 V +1 09/01/23, 08:52
-
Oliver Klee commented on patch set 5 09/01/23, 10:33
ContentObjectRenderer.php:3715ReplyDone -
Stefan Bürk commented on patch set 5 V +2 CR +2 09/08/23, 14:50
ContentObjectRenderer.php:3715ReplyGoing to merge this now. Technical, all flavours are valid. Postponing the needed bugfix because of this discussion, which needs to be done globally anyway, is not reasonable. Note: This does not reflect my opionion on this discussion or any decision on the discussion topic in generall. -
Stefan Bürk merged patch set 6 09/08/23, 15:06