[BUGFIX] Hide relations to deleted records
authorFrancois Suter <francois@typo3.org>
Tue, 24 Apr 2012 15:46:10 +0000 (17:46 +0200)
committerFrancois Suter <francois@typo3.org>
Fri, 27 Apr 2012 08:29:52 +0000 (10:29 +0200)
When displaying a column containing MM-relations in Web > List
view, deleted records will show up, because the MM relations still
exist and the foreign table is not checked for deleted records.

Additionally an empty result in this case should display "N/A"
just like for the other situations.

Change-Id: I71a244929ce69d7fd39c1038cb05d8c8414eb346
Fixes: #21713
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/10814
Reviewed-by: Francois Suter
Tested-by: Francois Suter
t3lib/class.t3lib_befunc.php

index 6d5bf5e..50c8010 100644 (file)
@@ -2360,7 +2360,7 @@ final class t3lib_BEfunc {
                                                                $MMres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                                                        'uid, ' . $MMfield,
                                                                        $theColConf['foreign_table'],
-                                                                               'uid IN (' . implode(',', $selectUids) . ')'
+                                                                       'uid IN (' . implode(',', $selectUids) . ')' . self::deleteClause($theColConf['foreign_table'])
                                                                );
                                                                while ($MMrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMres)) {
                                                                        $mmlA[] = ($noRecordLookup ? $MMrow['uid'] : self::getRecordTitle($theColConf['foreign_table'], $MMrow, FALSE, $forceResult));
@@ -2370,7 +2370,7 @@ final class t3lib_BEfunc {
                                                                if (is_array($mmlA)) {
                                                                        $l = implode('; ', $mmlA);
                                                                } else {
-                                                                       $l = '';
+                                                                       $l = 'N/A';
                                                                }
                                                        } else {
                                                                $l = 'N/A';