[BUGFIX] Fix user_labelFunc when uid is used as label 22/41622/4
authorPhilipp Thiele <philipp.thiele@phth.de>
Fri, 17 Jul 2015 21:12:29 +0000 (23:12 +0200)
committerBenjamin Mack <benni@typo3.org>
Fri, 17 Jul 2015 23:13:07 +0000 (01:13 +0200)
Resolves: #67756
Releases: master
Change-Id: I883740340c8f257c914d8677062590b41a20d2a7
Reviewed-on: http://review.typo3.org/41622
Tested-by: Philipp Thiele <philipp.thiele@phth.de>
Reviewed-by: Hans Mayer <hans.mayer83@gmail.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index c6c2b96..207adb7 100644 (file)
@@ -234,8 +234,14 @@ abstract class AbstractRecordList {
                $lastKey = '';
                $c = 0;
                $ccount = 0;
+               // __label is used as the label key to circumvent problems with uid used as label (see #67756)
+               // as it was introduced later on, check if it really exists before using it
+               $fields = $this->fieldArray;
+               if ($colType === 'td' && array_key_exists('__label', $data)) {
+                       $fields[0] = '__label';
+               }
                // Traverse field array which contains the data to present:
-               foreach ($this->fieldArray as $vKey) {
+               foreach ($fields as $vKey) {
                        if (isset($data[$vKey])) {
                                if ($lastKey) {
                                        $cssClass = $this->addElement_tdCssClass[$lastKey];
index 2f6d93a..ea8a496 100644 (file)
@@ -740,7 +740,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                                . htmlspecialchars($lockInfo['msg']) . '">'
                                                . IconUtility::getSpriteIcon('status-warning-in-use') . '</a>';
                                }
-                               $theData[$fCol] = $warning . $this->linkWrapItems($table, $row['uid'], $recTitle, $row);
+                               $theData[$fCol] = $theData['__label'] = $warning . $this->linkWrapItems($table, $row['uid'], $recTitle, $row);
                                // Render thumbnails, if:
                                // - a thumbnail column exists
                                // - there is content in it