From 0e44a16fbd1dac494e9872a388a779fd85434f29 Mon Sep 17 00:00:00 2001 From: phpnut Date: Sun, 4 Mar 2007 13:00:50 +0000 Subject: [PATCH] Adding fix for Ticket #2161 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4582 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 0d05626c8..180c6c2c0 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1676,7 +1676,7 @@ class Model extends Overloadable { ), $validator); if (empty($validator['on']) || ($validator['on'] == 'create' && !$this->exists()) || ($validator['on'] == 'update' && $this->exists())) { - if (!isset($data[$fieldName]) && $validator['allowEmpty'] == false) { + if (empty($data[$fieldName]) && $validator['allowEmpty'] == false) { $this->invalidate($fieldName, $validator['message']); } elseif (isset($data[$fieldName])) { if (is_array($validator['rule'])) {