From 29d171773db239283a055f087384037d53cb5fe3 Mon Sep 17 00:00:00 2001
From: Georg Ringer <georg.ringer@gmail.com>
Date: Sun, 23 Nov 2014 22:10:22 +0100
Subject: [PATCH] [BUGFIX] The raw search must check if field exists

The "raw search in all fields" must check if a field
exists in the table before building up the query.

Resolves: #63273
Releases: master, 6.2
Change-Id: I115ea3fb973c500308bb6a9f6799e9a3af65edcc
Reviewed-on: http://review.typo3.org/34510
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
---
 typo3/sysext/core/Classes/Database/QueryView.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/core/Classes/Database/QueryView.php b/typo3/sysext/core/Classes/Database/QueryView.php
index a993d3ca39dc..5ca22ce65077 100644
--- a/typo3/sysext/core/Classes/Database/QueryView.php
+++ b/typo3/sysext/core/Classes/Database/QueryView.php
@@ -485,7 +485,8 @@ class QueryView {
 				if (empty($conf['columns'])) {
 					continue;
 				}
-				$list = array_keys($conf['columns']);
+				$fieldsInDatabase = $GLOBALS['TYPO3_DB']->admin_get_fields($table);
+				$list = array_intersect(array_keys($conf['columns']), array_keys($fieldsInDatabase));
 				// Get query
 				$qp = $GLOBALS['TYPO3_DB']->searchQuery(array($swords), $list, $table);
 				// Count:
-- 
GitLab