[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 06:54:01 +0000 (08:54 +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: Ibfd879482ebf3ff5d75b9c8535bad440150c68bf
Fixes: #21713
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/10745
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Tomita Militaru
Tested-by: Tomita Militaru
Reviewed-by: Oliver Klee
Reviewed-by: Francois Suter
Tested-by: Francois Suter
t3lib/class.t3lib_befunc.php

index f85f7fd..1c5a250 100644 (file)
@@ -2058,7 +2058,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));
@@ -2068,7 +2068,7 @@ final class t3lib_BEfunc {
                                                                if (is_array($mmlA)) {
                                                                        $l = implode('; ', $mmlA);
                                                                } else {
-                                                                       $l = '';
+                                                                       $l = 'N/A';
                                                                }
                                                        } else {
                                                                $l = 'N/A';