From 133ea5b22256ac53ef348579bfa7cd41dc0920ff Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 25 Jun 2020 07:14:49 -0400 Subject: [PATCH] Update for processwire/processwire-issues#1198 --- wire/core/DatabaseQuery.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wire/core/DatabaseQuery.php b/wire/core/DatabaseQuery.php index 31586d01..9cd67d9e 100644 --- a/wire/core/DatabaseQuery.php +++ b/wire/core/DatabaseQuery.php @@ -641,7 +641,11 @@ abstract class DatabaseQuery extends WireData { } else { list($prepend, $split, $append) = $this->queryMethods[$method]; $values = $this->$method; - if(!is_array($values) || !count($values)) return ''; + if(!is_array($values)) return ''; + foreach($values as $key => $value) { + if(!strlen(trim($value))) unset($values[$key]); // remove any blank values + } + if(!count($values)) return ''; $sql = trim(implode($split, $values)); if(!strlen($sql) || $sql === trim($split)) return ''; $sql = $prepend . $sql . $append;