Skip to content
  • Helmut Hummel's avatar
    [BUGFIX] Make object access work with ObjectStorage · 9af2142b
    Helmut Hummel authored
    ObjectAccess->getPropertyPath() does not work with
    ObjectStorage and numerical indexes, but it should be
    because without it form fluid fields cannot be
    properly handled as the value is always null.
    
    Fixing fetching objects from ObjectStorage by index
    will also enable shorter access of single objects in Fluid.
    
    Imagine you want to render the first image in your
    template. Previously you had to write this:
    
    <f:for each="{object.images}" as="image" iteration="iterator">
    	<f:if condition="{iterator.isFirst}">
    		<f:image image="{image}" alt="" width="50"/>
    	</f:if>
    </f:for>
    
    Now you can just write:
    
    <f:image image="{object.images.0}" alt="" width="50"/>
    
    Resolves: #37126
    Related: #37000
    Releases: 6.2
    Change-Id: I45122bd145b5a179ad3e9e3894520f9a614906c8
    Reviewed-on: https://review.typo3.org/29923
    Reviewed-by: Markus Klein
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring
    Reviewed-by: Fabien Udriot
    Reviewed-by: Tymoteusz Motylewski
    Tested-by: Tymoteusz Motylewski
    Reviewed-by: Georg Ringer
    Tested-by: Georg Ringer
    9af2142b