From e1738c8c4a52fafb5e7519449be0d234684075cc Mon Sep 17 00:00:00 2001 From: Scott Harwell Date: Wed, 18 Jan 2012 15:04:53 -0500 Subject: [PATCH] Added check for NOT in key when array count === 1 to prevent SQL error --- lib/Cake/Model/Datasource/DboSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index ad4638635..30ce1274a 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -2368,7 +2368,7 @@ class DboSource extends DataSource { $keys = array_keys($value); if ($keys === array_values($keys)) { $count = count($value); - if ($count === 1) { + if ($count === 1 && !preg_match("/\s+NOT$/", $key)) { $data = $this->_quoteFields($key) . ' = ('; } else { $data = $this->_quoteFields($key) . ' IN (';