Review main Merged

82367[BUGFIX] Prevent type error on static route

Lina Wolf CR +2 V +2 Easy +3 −0 updated 01/18/24, 08:12

Commit message

If you happen to have inconsistent data in the
config.yaml like:

```
routes:
  -
    route: robots.txt
    type: staticText
    source: 'EXT:my_sitepackage_mysite/Resources/Public/robots.txt'
```

Currently a PHP type error is thrown instead of a proper exception.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • core-ci +1 CI

Issues 1

Files 1

Review log 1013

  1. Lina Wolf uploaded patch set 1 01/08/24, 09:09

  2. Lina Wolf updated the commit message in patch set 2 01/08/24, 09:10

  3. core-ci voted on patch set 1 V +1 01/08/24, 09:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51203

  4. core-ci voted on patch set 2 V +1 01/08/24, 09:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51205

  5. Stefan Bürk commented on patch set 2 CR -1 01/13/24, 23:44

    I think, simply throwing a exception here does not really help. From reading, I would say that simply using a null coalesce operator `??` on the content array key to a empty string is a more suitable solution. Ok, it would output nothing - but at least it will not hit an error. TBH - not tested yet, tried to verify or played around - will have a quick look after a couple hours of sleep.
  6. Stefan Bürk commented on patch set 2 01/13/24, 23:45

    Reply

    And - on switiching the type I guess the required structures needs to be added the the deprecated one removed (the invalid source) etc. But maybe another topic.
  7. Oliver Klee commented on patch set 2 CR +1 01/14/24, 09:00

    Reply

    As far as I understand the change, the purpose is to help an integrator locate potential problems with their setup. For this purpose, I like the approach of throwing an exception with a meaningful text.
  8. Oliver Klee updated the commit message in patch set 3 CR +1 V +1 01/14/24, 09:00

  9. Oliver Klee voted on patch set 3 CR +1 01/14/24, 09:00

  10. core-ci voted on patch set 3 V +1 01/14/24, 09:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51550

  11. Lina Wolf commented on patch set 3 01/14/24, 09:07

    Reply

    Yes the purpose is to make it easier for devs to detect that they have a flaw in their site-configuration. A type error does not tell me where in my site configuration the error can be found. This exception should do the trick. Also a null coalecense - while solving the "problem" of the type error would still not tell me where in my configuration is the error. I would see an empty file and have no idea why. Or I wouldn't even notice the file is empty if I had no test for it.
    Added a reply
  12. Benjamin Franzke commented on patch set 3 CR +2 V +2 01/18/24, 08:07

    Reply

    Acknowledged, we must avoid type error, fine to properly catch that.
  13. Benjamin Franzke merged patch set 4 01/18/24, 08:12