[BUGFIX] TS Object "FILES" is not able to handle multiple references
authorSteffen Ritter <info@rs-websystems.de>
Mon, 3 Sep 2012 10:49:41 +0000 (12:49 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 18 Sep 2012 17:15:26 +0000 (19:15 +0200)
The current implementation is not able to deal with more
than one file-reference (hand over as csv).

According to the documentation and to behave like other
options of the FILES object this should be adapted.

Change-Id: I79227dcabbcc92c355528df0f8ebb7e4f38d1dcb
Fixes: #39955
Releases: 6.0
Reviewed-on: http://review.typo3.org/14307
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php

index 5c0508e..dfa84a5 100644 (file)
@@ -55,9 +55,11 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                        references = 27
                         */
                        $referencesUid = $this->stdWrapValue('references', $conf);
-                       if ($referencesUid) {
-                               $this->addToArray($fileRepository->findFileReferenceByUid($referencesUid), $fileObjects);
+                       $referencesUidArray = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $referencesUid, TRUE);
+                       foreach ($referencesUidArray as $referenceUid) {
+                               $this->addToArray($fileRepository->findFileReferenceByUid($referenceUid), $fileObjects);
                        }
+
                        // It's important that this always stays "fieldName" and not be renamed to "field" as it would otherwise collide with the stdWrap key of that name
                        $referencesFieldName = $this->stdWrapValue('fieldName', $conf['references.']);
                        if ($referencesFieldName) {