[BUGFIX] Responsive sourceCollection width not usable out of the box 77/25077/5
authorPascal Hinz <hinz@elemente.ms>
Wed, 30 Oct 2013 14:56:52 +0000 (15:56 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 11 Feb 2014 23:59:35 +0000 (00:59 +0100)
The dimension settings in the source collections was overriden after
calculation. Now the result will not be overriden anymore.

Resolves: #53169
Releases: 6.2
Change-Id: I34b4dbab5e99b5cf3d790f92d06d11d31b9b8140
Reviewed-on: https://review.typo3.org/25077
Reviewed-by: Ingo Schmitt
Tested-by: Ingo Schmitt
Reviewed-by: Sebastian Fischer
Tested-by: Sebastian Fischer
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 454c550..4745ee6 100644 (file)
@@ -1457,7 +1457,7 @@ class ContentObjectRenderer {
                                $dimensionKeys = array('width', 'height', 'maxW', 'minW', 'maxH', 'minH');
                                foreach ($dimensionKeys as $dimensionKey) {
                                        $dimension = $this->stdWrap($sourceConfiguration[$dimensionKey], $sourceConfiguration[$dimensionKey . '.']);
-                                       if (!$dimension && isset($conf['file.'][$dimensionKey])) {
+                                       if (!$dimension) {
                                                $dimension = $this->stdWrap($conf['file.'][$dimensionKey], $conf['file.'][$dimensionKey . '.']);
                                        }
                                        if ($dimension) {
@@ -1471,9 +1471,10 @@ class ContentObjectRenderer {
                                                        $dimension = (int)($dimension * $pixelDensity);
                                                }
                                                $sourceRenderConfiguration['file.'][$dimensionKey] = $dimension;
+                                               // Remove the stdWrap properties for dimension as they have been processed already above.
+                                               unset($sourceRenderConfiguration['file.'][$dimensionKey . '.']);
                                        }
                                }
-
                                $sourceInfo = $this->getImgResource($sourceRenderConfiguration['file'], $sourceRenderConfiguration['file.']);
                                $sourceConfiguration['width'] = $sourceInfo[0];
                                $sourceConfiguration['height'] = $sourceInfo[1];