Project

General

Profile

Actions

Bug #102674

closed

Make DatabaseQueryProcessor available as nested DatabaseProcessor in FilesProcessor

Added by David Menzel over 1 year ago. Updated 3 months ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2023-12-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
DataProcessor, Fluid, Files, DatabaseQueryProcessor, FilesProcessor
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

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.

Actions #1

Updated by Georg Ringer about 1 year ago

  • Sprint Focus set to On Location Sprint
Actions #2

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;
Actions

Also available in: Atom PDF