[BUGFIX] Search also in translated records
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Classes / RecordList / DatabaseRecordList.php
index 578246f..68b1019 100644 (file)
@@ -544,10 +544,13 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
         if ($this->localizationView && $l10nEnabled) {
             $this->fieldArray[] = '_LOCALIZATION_';
             $this->fieldArray[] = '_LOCALIZATION_b';
-            $addWhere = (string)$queryBuilder->expr()->orX(
-                $queryBuilder->expr()->lte($GLOBALS['TCA'][$table]['ctrl']['languageField'], 0),
-                $queryBuilder->expr()->eq($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], 0)
-            );
+            // Only restrict to the default language if no search request is in place
+            if ($this->searchString === '') {
+                $addWhere = (string)$queryBuilder->expr()->orX(
+                    $queryBuilder->expr()->lte($GLOBALS['TCA'][$table]['ctrl']['languageField'], 0),
+                    $queryBuilder->expr()->eq($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], 0)
+                );
+            }
         }
         // Cleaning up:
         $this->fieldArray = array_unique(array_merge($this->fieldArray, $rowListArray));
@@ -763,10 +766,10 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
                         $cc++;
                         $this->translations = false;
                         $rowOutput .= $this->renderListRow($table, $row, $cc, $titleCol, $thumbsCol);
-                        // If localization view is enabled it means that the selected records are
-                        // either default or All language and here we will not select translations
+                        // If localization view is enabled and no search happened it means that the selected
+                        // records are either default or All language and here we will not select translations
                         // which point to the main record:
-                        if ($this->localizationView && $l10nEnabled) {
+                        if ($this->localizationView && $l10nEnabled && $this->searchString === '') {
                             // For each available translation, render the record:
                             if (is_array($this->translations)) {
                                 foreach ($this->translations as $lRow) {