[BUGFIX] getProcessedValue ignores foreign_table_field 35/37035/9
authorAndreas Allacher <andreas.allacher@gmx.at>
Fri, 20 Feb 2015 08:29:45 +0000 (09:29 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 27 Apr 2015 13:10:08 +0000 (15:10 +0200)
Currently BackendUtility::getProcessedValue method
ignores the foreign_table field.
This is basically a follow-up to commit:
c47c35744adb8b3243cbff5c91dc40672bec93f2

Change-Id: Ia08878a7a3cdcf7e1a0743c7ce84251a0b82fd82
Resolves: #63557
Related: #62755
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/37035
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Stephan Jorek <stephan.jorek@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 1f54f2f..d5bcba5 100644 (file)
@@ -2205,6 +2205,9 @@ class BackendUtility {
                                                        $rParts = array();
                                                        if ($uid && isset($theColConf['foreign_field']) && $theColConf['foreign_field'] !== '') {
                                                                $whereClause = '';
+                                                               if (!empty($theColConf['foreign_table_field'])) {
+                                                                       $whereClause .= ' AND ' . $theColConf['foreign_table_field'] . ' = ' . static::getDatabaseConnection()->fullQuoteStr($table, $theColConf['foreign_table']);
+                                                               }
                                                                // Add additional where clause if foreign_match_fields are defined
                                                                $foreignMatchFields = is_array($theColConf['foreign_match_fields']) ? $theColConf['foreign_match_fields'] : array();
                                                                foreach ($foreignMatchFields as $matchField => $matchValue) {