[BUGFIX] CSC: file references not working with image compression 56/28856/3
authorBenjamin Mack <benni@typo3.org>
Wed, 26 Mar 2014 16:30:58 +0000 (17:30 +0100)
committerFrans Saris <franssaris@gmail.com>
Thu, 27 Mar 2014 13:44:38 +0000 (14:44 +0100)
When using image compression with CSS styled content
all existing data in the $imgConf array is emptied.
If using a sys_file_reference, the file object
for resolving the file data does not consider
the option "treatIdAsReference" anymore as
it is unset as well.

How to reproduce: Add a file and select any image compression.
The wrong image is rendered, as the file UID is used
not the file reference UID.

If you have a sys_file UID 23, and a sys_file_reference ID 45
then the sys_file 45 is displayed instead of sys_file 23.

Releases: 6.2, 6.1
Resolves: #57346
Change-Id: Id503510b82df7bb4be9d236a1640322c92ffa5ec
Reviewed-on: https://review.typo3.org/28856
Reviewed-by: Tom Ruether
Tested-by: Tom Ruether
Reviewed-by: Wouter Wolters
Reviewed-by: Marc Bastian Heinrichs
Reviewed-by: Frans Saris
Tested-by: Frans Saris
typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php

index d44b99d..9dd4070 100644 (file)
@@ -726,9 +726,11 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                        if ($image_compression == 1) {
                                                $tempImport = $imgConf['file.']['import'];
                                                $tempImport_dot = $imgConf['file.']['import.'];
+                                               $tempTreatIdAsReference = $imgConf['file.']['treatIdAsReference'];
                                                unset($imgConf['file.']);
                                                $imgConf['file.']['import'] = $tempImport;
                                                $imgConf['file.']['import.'] = $tempImport_dot;
+                                               $imgConf['file.']['treatIdAsReference'] = $tempTreatIdAsReference;
                                        } elseif (isset($this->cObj->image_compression[$image_compression])) {
                                                $imgConf['file.']['params'] .= ' ' . $this->cObj->image_compression[$image_compression]['params'];
                                                $imgConf['file.']['ext'] = $this->cObj->image_compression[$image_compression]['ext'];