[BUGFIX] Add stdWrap to sorting.direction for FILES 23/35723/3
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:32:16 +0000 (11:32 +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/35723
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php

index 36f46e0..ef370ce 100644 (file)
@@ -148,7 +148,11 @@ class FilesContentObject extends AbstractContentObject {
                                        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);
                        }
                }