86301[BUGFIX] Handle all possible record values for json field types
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Garvin Hicking +1
- Benni Mack +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 2
Review log 1418
-
Oli Bartsch uploaded patch set 1 09/24/24, 15:18
-
core-ci voted on patch set 1 V +1 09/24/24, 15:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66506
-
Garvin Hicking commented on patch set 1 09/24/24, 15:40
Would we maybe wanto to throw an exception or log errors when this occurs in "real life"? -
Nikita Hovratov commented on patch set 1 CR -1 09/24/24, 15:49
null is a valid json value. See: https://stackoverflow.com/questions/8526995/is-null-valid-json-4-bytes-nothing-else -
Benjamin Franzke uploaded patch set 2
CR -1V +109/24/24, 17:20 -
Benjamin Franzke commented on patch set 2 09/24/24, 17:20
This is hard to test since https://forge.typo3.org/issues/105004 is still not resolved. But we should merge anyway.Reply
ack. -
core-ci voted on patch set 2 V +1 09/24/24, 17:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66512
-
Benjamin Franzke commented on patch set 2 09/24/24, 17:28
Reply
vendor/doctrine/dbal/src/Types/JsonType.php uses JSON_THROW_ON_ERROR and then generates `ValueNotConvertible`, which is then transformed into `RecordPropertyException` by typo3/sysext/core/Classes/Domain/Record.php. (we can not really test that easily right now, since we test the record field transformer directly instead of testing via RecordFactory (which I'd prefer, anyway, that's offtopic). As nikita correctly said, `null` is a valid json_decode result, so we should pass that through, therefore marking done. -
Benjamin Franzke updated the commit message in patch set 3
CR +1V +109/24/24, 19:02 -
core-ci voted on patch set 3 V +1 09/24/24, 19:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66515
-
Oli Bartsch uploaded patch set 4
CR +1V +109/24/24, 20:02 -
Oli Bartsch commented on patch set 4 09/24/24, 20:03
Reply
I added a test which shows that `RecordPropertyException` is thrown for an invalid JSON value. -
core-ci voted on patch set 4 V +1 09/24/24, 20:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66521
-
Garvin Hicking commented on patch set 4 CR +1 09/24/24, 20:19
Reply
I like that, much appreciated (and thanks benjamin for the explanation) -
Benjamin Franzke voted on patch set 4 CR +1 V +1 09/25/24, 05:14
-
Benni Mack voted on patch set 4 CR +1 V +1 09/25/24, 05:16
-
Benjamin Franzke commented on patch set 4 CR +2 V +2 09/25/24, 06:25
Tested again content-blocks main, the nightly error disappeared. -
Benjamin Franzke merged patch set 5 09/25/24, 06:25