mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 00:37:02 +02:00
Fix issue processwire/processwire-issues#1567
This commit is contained in:
@@ -2115,8 +2115,15 @@ class PageFinder extends Wire {
|
||||
// non-presence of row is equal to value being blank
|
||||
$bindKey = $query->bindValueGetKey($blankValue);
|
||||
if($ft->isEmptyValue($field, $value)) {
|
||||
// matching an empty value: null or literal empty value
|
||||
$sql = "$tableAlias.$col IS NULL OR ($tableAlias.$col=$bindKey";
|
||||
if($value === '' && !$ft->isEmptyValue($field, '0') && $field->get('zeroNotEmpty')) {
|
||||
// MySQL blank string will also match zero (0) in some cases, so we prevent that here
|
||||
// @todo remove the 'zeroNotEmpty' condition for test on dev as it limits to specific fieldtypes is likely unnecessary
|
||||
$sql .= " AND $tableAlias.$col!='0'";
|
||||
}
|
||||
} else {
|
||||
// matching a non-empty value
|
||||
$sql = "($tableAlias.$col=$bindKey";
|
||||
}
|
||||
/*
|
||||
|
Reference in New Issue
Block a user