[BUGFIX] Add stdWrap to sorting.direction for FILES 22/35922/2
authorBenjamin Mack <benni@typo3.org>
Fri, 2 Jan 2015 11:02:27 +0000 (12:02 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Fri, 9 Jan 2015 10:33:07 +0000 (11:33 +0100)
Add the missing stdWrap support for the sorting direction
property of the new FILES cObject.

Resolves: #59297
Releases: master, 6.2
Change-Id: I827f3318419824a9b125b04a09fdd4f7dde443fd
Reviewed-on: http://review.typo3.org/35922
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php

index 17dfd1b..924d9fd 100644 (file)
@@ -148,7 +148,11 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                        return 0;
                                }
                        });
-                       if (is_array($conf['sorting.']) && isset($conf['sorting.']['direction']) && strtolower($conf['sorting.']['direction']) === 'desc') {
+                       $sortingDirection = isset($conf['sorting.']['direction']) ? $conf['sorting.']['direction'] : '';
+                       if (isset($conf['sorting.']['direction.'])) {
+                               $sortingDirection = $this->cObj->stdWrap($sortingDirection, $conf['sorting.']['direction.']);
+                       }
+                       if (strtolower($sortingDirection) === 'desc') {
                                $fileObjects = array_reverse($fileObjects);
                        }
                }