1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-27 00:25:05 +02:00

Fix issue processwire/processwire-issues#189 FieldtypeOptions and "!=" operators

This commit is contained in:
Ryan Cramer
2017-03-07 10:31:13 -05:00
parent f32593adfa
commit c4ea3c3356

View File

@@ -325,6 +325,8 @@ class FieldtypeOptions extends FieldtypeMulti implements Module {
$s = $database->escapeCol($subfield); $s = $database->escapeCol($subfield);
$v = $database->escapeStr($value); $v = $database->escapeStr($value);
$query->where("(SELECT COUNT(*) FROM $t WHERE $t.pages_id=pages.id AND $t.$s='$v')=0"); $query->where("(SELECT COUNT(*) FROM $t WHERE $t.pages_id=pages.id AND $t.$s='$v')=0");
$query->parentQuery->where("($table.data IS NULL OR $table.$s!='$v')");
return $query;
} }
return parent::getMatchQuery($query, $table, $subfield, $operator, $value); return parent::getMatchQuery($query, $table, $subfield, $operator, $value);