[BUGFIX] Missing column in t3lib_TCEmain::getPreviousLocalizedRecordUid
authorFrancois Suter <francois@typo3.org>
Tue, 27 Mar 2012 07:52:10 +0000 (09:52 +0200)
committerFrancois Suter <francois@typo3.org>
Wed, 28 Mar 2012 07:13:06 +0000 (09:13 +0200)
Method t3lib_TCEmain::getPreviousLocalizedRecordUid() checks for the
"closest" localized record. For content elements it does this per
column, but actually fails because the "colPos" field is not among
the available fields. It must be added to the selection.

Change-Id: I9ee37697484a56345c21938515a265e0f47fe801
Fixes: #35260
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/9961
Reviewed-by: Francois Suter
Tested-by: Francois Suter
t3lib/class.t3lib_tcemain.php

index ce89878..e951604 100644 (file)
@@ -6075,6 +6075,10 @@ class t3lib_TCEmain {
                $previousLocalizedRecordUid = $uid;
                if ($GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['sortby']) {
                        $sortRow = $GLOBALS['TCA'][$table]['ctrl']['sortby'];
+                               // For content elements, we also need the colPos
+                       if ($table === 'tt_content') {
+                               $sortRow .= ',colPos';
+                       }
                                // Get the sort value of the default language record
                        $row = t3lib_BEfunc::getRecord($table, $uid, $sortRow . ',pid,uid');
                        if (is_array($row)) {