[BUGFIX] Fix type check in advanced query search 12/34412/2
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 17 Nov 2014 19:26:58 +0000 (20:26 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 20 Nov 2014 21:28:04 +0000 (22:28 +0100)
TCA fields with type "check" and items are handled as
binary fields which is wrong. Fields are used e.g. for the
field "hidden" of pages to improve the output.

Therefore the check needs to be extended if there are at least
2 items in the item configuration.

Resolves: #51982
Releases: master, 6.2
Change-Id: I4a0cc31790e4f12527655b6abfa5cd1eda6dd9c7
Reviewed-on: http://review.typo3.org/34412
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Database/QueryGenerator.php

index f5e53e3..1b03955 100644 (file)
@@ -283,7 +283,7 @@ class QueryGenerator {
                                                        }
                                                        break;
                                                case 'check':
-                                                       if (!$this->fields[$fN]['items']) {
+                                                       if (!$this->fields[$fN]['items'] || count($this->fields[$fN]['items']) <= 1) {
                                                                $this->fields[$fN]['type'] = 'boolean';
                                                        } else {
                                                                $this->fields[$fN]['type'] = 'binary';