Bug #29395

SelectViewHelper with multiple=true cannot work with Collections

Added by Ferdinand Kuhl about 10 years ago. Updated almost 10 years ago.

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

0%

Estimated time:
Has patch:
No

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:

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

(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.


Files

patch29395.diff (4.65 KB) patch29395.diff Johannes K, 2011-09-02 20:13

Related issues

Has duplicate TYPO3.Fluid - Bug #31939: preselection with a multiple form.select with a M:N relationResolved2011-11-19

Actions
#1

Updated by Johannes K about 10 years ago

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

#2

Updated by Ferdinand Kuhl about 10 years 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...

#3

Updated by Johannes K about 10 years 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

#4

Updated by Mr. Hudson about 10 years ago

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

#6

Updated by Mr. Hudson almost 10 years ago

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

#7

Updated by Mr. Hudson almost 10 years ago

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

#8

Updated by Sebastian Kurfuerst almost 10 years 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