Hi,
I think, I’ve found the cause of this problem and can provide two possible solutions:
For testing purposes we add two already (FAL-) indexed files to a collection with e.g. sys_file_collection UID=2 and two other files are placed by FTP into the fileadmin-directory (Storage with storageUid=1, folderIdentifier "images" => so that they are not available in FAL-tables).
Consider the followingTyposcript:
page.10 >
page.10 = FILES
page.10 {
folders = 1:images/
collections = 2
}
If you rendert he page unsing the renderObj shown in the original Bugreport, only the files within the collection are shown.
Walking through the code shows:
typo3\sysext\frontend\Classes\ContentObject\FilesContentObject.php function render Line 154:
foreach ($fileObjects as $key => $fileObject) {
$this->cObj->setCurrentFile($fileObject);
$content .= $this->cObj->cObjGetSingle($splitConf[$key]['renderObj'], $splitConf[$key]['renderObj.']);
}
The $fileObjects contains 4 entries, which would be corret, but the files from the collection are stored with an integer based array-key and the files from folder have their filename as array-key.
You can see in the getFiles function, that the „folder-files“ have their filename set as key:
typo3\sysext\core\Classes\Resource\Folder.php function getFiles Line 201:
$fileObjects[$fileInfo['name']] = $factory->createFileObject($fileInfo);
Now the problem is, that the $splitConf is an integer based array, therefore no splitconf will be found for the „folder-fileObjects“, due to a „wrong key“ in the foreach statement.
There are two possible solutions:
- Either use a counter within the foreach instead of „$key“ to access the corresponding $splitConf
- Or remove the „$fileInfo['name']“ while adding folder files to the $fileObjects in getFiles-function.
Both will work, but I do not know if the Array-key created in getFiles is used somewhere else in the code.
Kind regards
Andreas