96975[BUGFIX] Keep the choice of a select bound to a list
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Matthias Vogel +1
-
Verified V +2 Done
- Oli Bartsch +2
- Matthias Vogel +1
- core-ci +1 CI
Issues 1
Files 3
Review log 79
-
Benjamin Kott uploaded patch set 1 10/21/26, 15:23
-
core-ci voted on patch set 1 V +1 10/21/26, 15:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112013
-
Oli Bartsch commented on patch set 1 V -1 10/21/26, 18:27
SelectViewHelper.php:69please don't check for any `\Traversable`. On 14.3 the `LazyLoadingProxy` used for lazy 1:1/n:1 relations implements `\Iterator`, so a single-value select gets the name `[]` append. On submit this would throws an exception. This would be a regression for the most common select case. I suggest to match what the commit message says: `is_array($propertyValue) || $propertyValue instanceof ObjectStorage`. `LazyObjectStorage` extends `ObjectStorage`, so lazy collections stay covered. Excluding `LoadingStrategyInterface` instead would not work, as `LazyObjectStorage` implements it too.SelectViewHelperTest.php:739please add a test where a single-valued `\Traversable` property keeps the scalar name, as it would have caught the problem above. An empty `ObjectStorage` with `prependOptionLabel` (the setup from the issue) and a mapping test that `x[]=5` ends up as a populated `ObjectStorage` would also be good. -
Benjamin Kott uploaded patch set 2
V +110/22/26, 10:51 -
Benjamin Kott commented on patch set 1 10/22/26, 10:51
SelectViewHelper.php:68ReplyAgreed. Patch set 2 rewords the commit message and the RST to "whose current value is an array or ObjectStorage". The RST now also names the case of a form without an object or a null property, and that initializing the property with an empty ObjectStorage avoids it.SelectViewHelper.php:69ReplyDone in patch set 2: `is_array($propertyValue) || $propertyValue instanceof ObjectStorage`. Thanks, the test for a single-valued \Traversable fails on patch set 1 with the list name and trusted properties [1].SelectViewHelperTest.php:739ReplyAdded both rendering tests in patch set 2: a single-valued \Traversable keeps the scalar name, and an empty ObjectStorage with prependOptionLabel renders the list name. I did not add a mapping test: mapping a [] list into an ObjectStorage is not changed by this patch and is already covered by BlogPostEditingControllerTest::fullyLocalizedFormSubmissionPersistsDataOfSelectedBlogForRequestedTranslation, which also notes that the scalar trusted property does not work. A round trip in the fluid test would need blog_example and a database in a test class that runs without one. Happy to add it if you think it is worth that. -
core-ci voted on patch set 2 V +1 10/22/26, 10:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112092
-
Matthias Vogel voted on patch set 2 CR +1 V +1 10/22/26, 13:20
-
Oli Bartsch commented on patch set 2 CR +2 V +2 10/22/26, 20:09
SelectViewHelper.php:68ReplyDoneSelectViewHelper.php:69ReplyDoneSelectViewHelper.php:69ReplyDoneSelectViewHelperTest.php:739ReplyDone -
Oli Bartsch merged patch set 3 10/22/26, 20:16
SelectViewHelper.php:68