Project

General

Profile

Actions

Bug #90970

closed

FilesProcessor ignores 'as' parameter

Added by Justus Köster over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2020-04-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

When using the FilesProcessor in TypoScript for getting an image object in the Frontend as Fluid variable, the 'as' variable name is not evaluated and replaced with Default Value

Prerequisites

Add an image to a page via Page Properties, Tab Resources, Media

Steps to reproduce the problem

Add FilesProcessor in TypoScript to FLUIDTEMPLATE. Add 'as' parameter to change the name of the Variable in the frontend.
Try to access it in fluid, e.g. via <f:debug>{_all}</f:debug> on the page.

Example:

page {
    10 = FLUIDTEMPLATE
    10 {
        dataProcessing {
            10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
            10.references {
                fieldName = media
                as = imageObject
            }
        }
}

Actual results

The Image is available via Fluid Variable 'files'.

Expected results

Image should be available via Variable 'imageObject' (Name from TypoScript)

Suggested Fix

I figured out, that the Problem seems to be in the FilesProcessor.php itself (TYPO3\CMS\Frontend\DataProcessing\FilesProcessor).

Line 118:

$targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, 'files');

should be

$targetVariableName = $cObj->stdWrapValue('as', $referenceConfiguration, 'files');

$referenceConfiguration contains the 'fieldName' and the 'as' from TypoScript, $processorConfiguration holds the whole configuration. And because the Key 'as' cant be found in $processorConfiguration, the default value 'files' is used.

Actions

Also available in: Atom PDF