Bug #31939

preselection with a multiple form.select with a M:N relation

Added by Matthias Habegger over 3 years ago. Updated over 2 years ago.

Status:Resolved Start date:2011-11-19
Priority:Must have Due date:
Assigned To:- % Done:

100%

Category:ViewHelpers
Target version:-
Has patch:No Affected Flow version:FLOW3 1.0.0

Description

I have a M:N relation between my two model "book" and "category".

Now I try to create a multiple select with the SelectViewHelper like that:

<f:form.select property="categories" options="{categories}" optionLabelField="name" multiple="multiple" size="7" />

{categories} is a variable assigned in the controller.
that works fine, all, categories are shown in the select.

The problem is, that none of my preselected categories are selected.

The html output looks like that:

<input type="hidden" name="book[categories]" value="" />
<select id="categories" multiple="multiple" size="7" name="book[categories][]">
<option value="0bc305ec-8aff-4fa8-bdeb-476d7c21c841">Novels</option>
<option value="8c2221e3-a3fd-4ce2-8f7e-66aac9eed5f5">Second Category</option>
<option value="c1ca0c2d-08c4-4b22-b9c7-69bbd42de840">Third category</option>
</select>

I analized the problem and it seems, that the method "getSelectedValue" in the "SelectViewHelper" can't handle multiple preselects.

I think the problem is also in the blog-tutorial when you try to edit post which already has related posts, they are not selected.


Related issues

duplicates TYPO3.Fluid - Bug #29395: SelectViewHelper with multiple=true cannot work with Coll... Resolved 2011-08-31

History

#1 Updated by Matthias Habegger over 3 years ago

  • % Done changed from 0 to 100

Problem solved with 1.0.1

#2 Updated by Johannes K over 3 years ago

Duplicate of #29395
Can anybody close this?

#3 Updated by Karsten Dambekalns over 2 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF