Bug #29395

SelectViewHelper with multiple=true cannot work with Collections

Added by Ferdinand Kuhl over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2011-08-31
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:TYPO3 Flow Base Distribution - 1.0.1
Has patch:No FLOW3 version affected:FLOW3 1.0.0
Votes: 0

Description

When using collections as preselected values for SelectView-Helper with option multiple="1" the preselection is only possible when you have a "public" identity field.

The preselection for lists does only work if "optionValueField"-Argument is set, which you cannot use with the internal flow3-identity.

First part of the solution is:

 1 /**
 2  * Retrieves the selected value(s)
 3  *
 4  * @return mixed value string or an array of strings
 5  * @author Bastian Waidelich <bastian@typo3.org>
 6  */
 7 protected function getSelectedValue() {
 8     $value = $this->getValue();
 9     if (!$this->hasArgument('optionValueField') && ! is_array($value)) {
10         return $value;
11     }

(Important is the & ! is_array())

But than further the code runs in the next problem selecting by using $this->arguments['optionValueField'] to retrieve the value.

patch29395.diff (4.7 kB) Johannes K, 2011-09-02 20:13


Related issues

duplicated by TYPO3.Fluid - Bug #31939: preselection with a multiple form.select with a M:N relation Resolved 2011-11-19

Associated revisions

Revision 1d9943d2
Added by Johannes K over 1 year ago

[BUGFIX] pre-selecting entities does not work with multiple flag set

The SelectViewHelper is not able to retrieve the selected uuid values for
a collection of objects

Change-Id: Ifc005c58287c4d1479bb42eb04455f38c37efc40
Resolves: #29395
Releases: 1.0, 1.1

Revision 2a960bfe
Added by Johannes K over 1 year ago

[BUGFIX] pre-selecting entities does not work with multiple flag set

The SelectViewHelper is not able to retrieve the selected uuid values for
a collection of objects

Change-Id: Ib7da7fd0d0906ab4ba37c5e1b5c09ce0e2cf3dfa
Fixes: #29395
Releases: 1.0, 1.1

History

Updated by Johannes K over 1 year ago

Had this issue, too.
Attached a patch (including testcase)

Updated by Ferdinand Kuhl over 1 year ago

Would you mind, if I push your patch to gerrit?
I do remember that there somewhere is a task to refactor all form-elements, so perhaps the core team already adresses this issue...

Updated by Johannes K over 1 year ago

I would be happy if you could push it to Gerrit.
I would do it myself, but I haven't signed the CLA yet.
Thanks, Johannes

Updated by Mr. Hudson over 1 year ago

Patch set 1 of change Ifc005c58287c4d1479bb42eb04455f38c37efc40 has been pushed to the review server.
It is available at http://review.typo3.org/5361

Updated by Karsten Dambekalns over 1 year ago

  • FLOW3 version affected set to FLOW3 1.0.0

Updated by Mr. Hudson over 1 year ago

Patch set 2 of change Ifc005c58287c4d1479bb42eb04455f38c37efc40 has been pushed to the review server.
It is available at http://review.typo3.org/5361

Updated by Mr. Hudson over 1 year ago

Patch set 3 of change Ifc005c58287c4d1479bb42eb04455f38c37efc40 has been pushed to the review server.
It is available at http://review.typo3.org/5361

Updated by Sebastian Kurfuerst over 1 year ago

  • Status changed from New to Resolved
  • Target version set to 1.0.1

thanks a lot for the patchset :)

Also available in: Atom PDF