Bug #64057

Checkbox viewhelper checked attribute not set for objects

Added by Mathias Brodala almost 5 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Must have
Category:
Fluid
Target version:
Start date:
2014-12-30
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Description

Given a form object with a property which may contain a list of objects (array/ObjectStorage) as well as a list of checkboxes built from all available objects for that property:

<f:form object="{object}" name="object">
  <f:for each="{availableObjects}" as="availableObject">
    <f:form.checkbox
      property="foo" 
      value="{availableObject}" 
      multiple="1"/>
  </f:for>
</f:form>

If you select one of the options, the checked attribute is not properly set on the subsequent form display. This is due to the fact that the CheckboxViewHelper converts the incoming value for the value attribute to an identifier through AbstractFormFieldViewHelper::getValue() but does not do the same for the property value. Thus e.g. an UID like 42 is searched in an array of objects which will never succeed. (Source)

A possible fix is to run PersistenceManager->getIdentifierByObject on each value within property too, thus comparing e.g. an UID with an array of UIDs. This is the same what AbstractFormFieldViewHelper::getValue() does when $convertObjects is set to TRUE (default).


Related issues

Related to TYPO3 Core - Feature #62436: Checkbox checked when Object has multiple values from a m:n related table Closed 2014-10-23
Related to TYPO3 Core - Bug #61099: CheckboxViewhelper and Objects Closed 2014-08-20

Associated revisions

Revision bf15f29d (diff)
Added by Mathias Brodala over 4 years ago

[BUGFIX] Properly set checked attribute for objects

This makes sure the checked attribute is properly set by the
CheckboxViewHelper for a list of objects.

Resolves: #64057
Releases: master, 6.2
Change-Id: I7b25d2086b8e1d436730283e30a6df0eda34712a
Reviewed-on: http://review.typo3.org/35668
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

Revision 460623f8 (diff)
Added by Andreas Fernandez over 4 years ago

[BUGFIX] Properly set checked attribute for objects

This makes sure the checked attribute is properly set by the
CheckboxViewHelper for a list of objects.

Resolves: #64057
Releases: master, 6.2
Change-Id: I7b25d2086b8e1d436730283e30a6df0eda34712a
Reviewed-on: http://review.typo3.org/38880
Reviewed-by: Mathias Brodala <>
Tested-by: Mathias Brodala <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

History

#1 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35668

#2 Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35668

#3 Updated by Alexander Schnitzler over 4 years ago

Will have a look at it.

#4 Updated by Gerrit Code Review over 4 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35668

#5 Updated by Gerrit Code Review over 4 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35668

#6 Updated by Gerrit Code Review over 4 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35668

#7 Updated by Gerrit Code Review over 4 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35668

#8 Updated by Anja Leichsenring over 4 years ago

  • Sprint Focus set to Stabilization Sprint

#9 Updated by Anja Leichsenring over 4 years ago

  • Target version changed from next-patchlevel to 7.2 (Frontend)

#10 Updated by Gerrit Code Review over 4 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35668

#11 Updated by Mathias Brodala over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#12 Updated by Gerrit Code Review over 4 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38880

#13 Updated by Andreas Fernandez over 4 years ago

  • Status changed from Under Review to Resolved

#14 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF