80178[BUGFIX] Do not try to explode null in ResourceStorage
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Alexander Schnitzler +1
- Oliver Hader +1
-
Verified V +2 Done
- Stefan Bürk +2
- Alexander Schnitzler +1
- core-ci +1 CI
Issues 1
Files 1
Review log 1112
-
Oliver Klee uploaded patch set 1 07/26/23, 07:52
-
core-ci voted on patch set 1 V +1 07/26/23, 07:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44570
-
Oliver Hader voted on patch set 1 CR +1 07/26/23, 10:16
-
Oliver Hader commented on patch set 1 07/26/23, 10:19
Did that actually happen (how to reproduce)? Otherwise this sounds more like a clean-up `[TASK]` instead of a `[BUGFIX]`. In general the change seems to be reasonable. -
Oliver Klee commented on patch set 1 07/26/23, 10:31
Reply
Yes, this happens in the functional tests. If we switch GU::trimExplode to native type declarations and run the functional tests, we'd get a type error: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75083 -
Alexander Schnitzler commented on patch set 1 07/26/23, 13:21
Reply
What about adjusting the functional test(s) as well? I have seen there are many mocks in this area without knowing the exact failing test I assume the test in question did mock `getStorageRecord()` and didn't have `processingfolder` set which probably doesn't happen in RL. -
Stefan Bürk commented on patch set 1 V +1 CR +1 07/26/23, 13:25
Reply
@Oliver Hader It's not about a not set array key, but about containing a "null". This happens per default as the `processingfolder` field of `sys_file_storage` is defined as tinytext. This cannot be made not nullabe on all dbms. An empty entry is saved as "null" in the database. I have this for the fileadmin storage in simple mono-repo installation. Simply add a xdebug breakpoint on the line with the change and use this condition: ``` $storage->getStorageRecord()['processingfolder'] === null ``` and enable xdebug in the backend. Simply open the filelist module and the break point will be hit. There is no php warning for it because the array key exists, just having the value null. Currently it's not an "error" - so `[TASK]` may be sufficient for it. It would be a bugfix with the mentioned pending patch (which fails). I would tend to keep the `[BUGFIX]` here. What do you think, Oliver Hader ? -
Stefan Bürk commented on patch set 1 07/26/23, 13:30
Reply
@Alexander I looked into some tests. No mocking there, just retrieving database content. Sure, we can adjust the test fixtures in the related change to save an empty string for the processingfolder field - but that would not match the reality. Therefore, this change/fix is valid. And the tests should not be adopted as they remind us on these cases. -
Alexander Schnitzler commented on patch set 1 07/26/23, 13:45
Reply
Sure, it's a valid fix either way but if there was mocking involved, I would have adjusted the test on top. If it's a real world scenario, even worse. -
Alexander Schnitzler voted on patch set 1 V +1 CR +1 07/26/23, 13:45
-
Stefan Bürk voted on patch set 1 V +2 CR +2 07/26/23, 19:06
-
Stefan Bürk merged patch set 2 07/26/23, 19:25