Skip to content

Commit e8f8317

Browse files
1 parent 8322725 commit e8f8317

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

wire/core/PageFinder.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,12 @@ protected function ___getQuery($selectors, array $options) {
18361836
if(in_array($operator, array('=', '!=', '<', '<=', '>', '>='))) {
18371837
// we only accommodate this optimization for single-value selectors...
18381838
if($this->whereEmptyValuePossible($field, $subfield, $selector, $query, $value, $whereFields)) {
1839-
if(count($valueArray) > 1 && $operator == '=') $whereFieldsType = 'OR';
1839+
if(count($valueArray) > 1) {
1840+
if($operator == '=') $whereFieldsType = 'OR';
1841+
} else {
1842+
$fieldCnt[$field->table]--;
1843+
if($fieldCnt[$field->table] < 1) unset($fieldCnt[$field->table]);
1844+
}
18401845
continue;
18411846
}
18421847
}
@@ -2241,6 +2246,7 @@ protected function whereEmptyValuePossible(Field $field, $col, $selector, $query
22412246
}
22422247

22432248
$query->leftjoin("$table AS $tableAlias ON $tableAlias.pages_id=pages.id");
2249+
bd("leftjoin $table as $tableAlias on $tableAlias.pages_id=pages.id");
22442250
$where .= strlen($where) ? " $whereType ($sql)" : "($sql)";
22452251

22462252
return true;

0 commit comments

Comments
 (0)