1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-26 16:14:35 +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);
$v = $database->escapeStr($value);
$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);