[BUGFIX] Fix type check in advanced query search 79/34279/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:24:14 +0000 (22:24 +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/34279
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Database/QueryGenerator.php

index 6a51433..3347e6d 100644 (file)
@@ -289,7 +289,7 @@ class QueryGenerator {
                                                        }
                                                        break;
                                                case 'check':
-                                                       if (!$this->fields[$fieldName]['items']) {
+                                                       if (!$this->fields[$fieldName]['items'] || count($this->fields[$fieldName]['items']) <= 1) {
                                                                $this->fields[$fieldName]['type'] = 'boolean';
                                                        } else {
                                                                $this->fields[$fieldName]['type'] = 'binary';