Issue Bug Closed

#81862CropVariants with static title break content elements, also Installed Services on reports module are broken

Daniel Goerz 07/13/17, 22:53 updated 10/02/18, 10:58

Description

Reproduce:

Add a custom cropVariant with a static title (no locallang string with LLL:). E.g.:

$GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config'] = [
        'type' => 'imageManipulation',
        'cropVariants' => [
            'mobile' => [
                'title' => 'Mobile',
                'focusArea' => [
                    'x' => 1 / 3,
                    'y' => 1 / 3,
                    'width' => 1 / 3,
                    'height' => 1 / 3,
                ],
                'allowedAspectRatios' => [
                    '4:3' => [
                        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.4_3',
                        'value' => 4 / 3
                    ],
                    'NaN' => [
                        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.free',
                        'value' => 0.0
                    ],
                ],
            ]

The title is passed to the f:translate ViewHelper wich passes it to LocalizationUtility which was changed in #81168 to throw an exception if the passed key does not start with LLL and no $extensionName is given. The newly introduced exception is not catched in the ViewHelper, so a possible $default value is not rendered.

Therefore it is not possible to add any image to a content element with the cropVariant above, neither is it possible to edit an existing image because the AJAX calls will always run in the exception.

Reviews 2