Bug #102674
closedMake DatabaseQueryProcessor available as nested DatabaseProcessor in FilesProcessor
0%
Description
I wanted to get the categories of files (used in a filecollection, CType uploads) and noticed that the fluid array had only categories as integer value with the number of categories used, not the particular selected categories.
I tried to add an additional nested DatabaseQueryProcessor but that didn't work.
It seems like that nested DataProcessors are not allowed in a FilesProcessor, comparing with the MenuProcessor, for example.
It would be great if nested DataProcessors would also be available in a FilesProcessor and that the selected categories would be directly available in fluid when using the FilesProcessor or in this example, in the uploads content element but it should also work out-of-the-box on other content elements.
Not sure if that is a bugfix or new feature.
Updated by Georg Ringer 3 months ago
- Status changed from New to Rejected
hey!
thanks for creating the issue. I checked it and this is currently not possible to solve because the filesprocessor gives back an array of filereferences which can't be used in another dataprocessor as input.
I suggest creating either a custom filesprocessor which enhances the records or use a custom VH to get the data you need
the modifications I did was
$processedRecordVariables = []; foreach ($fileCollector->getFiles() as $key => $file) { $recordContentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class); $recordContentObjectRenderer->setRequest($cObj->getRequest()); $recordContentObjectRenderer->start($file->toArray(), 'sys_file_reference'); $processedRecordVariables[$key] = ['data' => $file->toArray()]; $processedRecordVariables[$key] = $this->contentDataProcessor->process($recordContentObjectRenderer, $processorConfiguration, $processedRecordVariables[$key]); } // set the files into a variable, default "files" $targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, 'files'); $processedData[$targetVariableName] = $processedRecordVariables;