94847[BUGFIX] Preserve option order of DB-stored forms on MySQL
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Stefan Bürk +1
- Josua Vogel +1
-
Verified V +2 Done
- Oli Bartsch +2
- Stefan Bürk +1
- Josua Vogel +1
- core-ci +1 CI
Issues 2
Files 5
- typo3/sysext/form/Classes/Domain/Repository/FormDefinitionRepository.php+5 −3
- typo3/sysext/form/Classes/Storage/DatabaseStorageAdapter.php+2 −0
- typo3/sysext/form/Classes/Storage/JsonObjectKeyOrderPreserver.php3new+110 −0
- typo3/sysext/form/Tests/Functional/Storage/DatabaseStorageAdapterFunctionalTest.php1+43 −0
- typo3/sysext/form/Tests/Unit/Storage/JsonObjectKeyOrderPreserverTest.php4new+161 −0
Review log 1218
-
Oli Bartsch uploaded patch set 1 07/20/26, 12:10
-
core-ci voted on patch set 1 V -1 07/20/26, 12:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105027
-
core-ci voted on patch set 1 V +1 07/20/26, 12:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105027
-
Josua Vogel updated the commit message in patch set 2
V +107/20/26, 16:33 -
core-ci voted on patch set 2 V +1 07/20/26, 16:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105037
-
Stefan Bürk commented on patch set 2 07/21/26, 16:51
JsonObjectKeyOrderPreserverTest.php:31No need to have that as a property. Can be simply ctated in the test method(s). -
Stefan Bürk commented on patch set 2 07/21/26, 16:52
Should that not be covered by a functional tests really writing into the database and restoring it to see if it changes or not ? (or is preserved) ? -
Oli Bartsch uploaded patch set 3
V +107/21/26, 20:19 -
Oli Bartsch commented on patch set 3 07/21/26, 20:19
Reply
DoneJsonObjectKeyOrderPreserverTest.php:24ReplyDoneJsonObjectKeyOrderPreserverTest.php:31ReplyDone -
core-ci voted on patch set 3 V +1 07/21/26, 20:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105122
-
core-ci commented on patch set 3 07/21/26, 21:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105129
-
Stefan Bürk commented on patch set 3 07/22/26, 00:53
JsonObjectKeyOrderPreserver.php:60```suggestion final readonly class JsonObjectKeyOrderPreserver ```JsonObjectKeyOrderPreserver.php:64`protect()` is not idempotent. Running it twice would re-wrap the wrapper (the wrapper is itself a non-list map under key `options`… no — the wrapper is under the original `options` key; a second pass sees `options => {marker,order, values}` which is a non-list map and *would* wrap again). In the normal flow this cannot happen: the in-memory `FormData` is always the *restored* (clean) form, so persist always starts from unwrapped data. Latent fragility only if a future caller ever persists an already-protected array. Low risk; could be hardened with an early `if isset($value[self::MARKER]) continue;` guard, but not required. -
Stefan Bürk commented on patch set 4
V +107/22/26, 00:54Published edit on patch set 3. -
core-ci voted on patch set 4 V +1 07/22/26, 01:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105131
-
Stefan Bürk commented on patch set 4 CR +1 V +1 07/22/26, 01:04
Reply
Thanks for adding one.JsonObjectKeyOrderPreserver.php:60ReplyFix applied.DatabaseStorageAdapterFunctionalTest.php:135Verified locally that this functional test fails (red) without the fix, which confirms that the change really works and is the real regression check on db persisting layer (for this narrowed down issue). Thanks for adding it as requested. -
Josua Vogel voted on patch set 4 CR +1 V +1 07/22/26, 08:33
-
Oli Bartsch voted on patch set 4 CR +2 V +2 07/22/26, 08:50
-
Oli Bartsch merged patch set 5 07/22/26, 08:50
JsonObjectKeyOrderPreserverTest.php:24