From 64e7390a6ba371e350b30ddff56b71c484f0609f Mon Sep 17 00:00:00 2001 From: gwoo Date: Fri, 30 Nov 2007 23:31:41 +0000 Subject: [PATCH] updating model habtm saving, check against current hatbm aliases git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6099 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/model.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index d82859ad5..016784989 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1131,10 +1131,8 @@ class Model extends Overloadable { return false; } $fields = $values = array(); - $habtm = count($this->hasAndBelongsToMany); - foreach ($this->data as $n => $v) { - if (isset($v[$n]) && $habtm > 0) { + if (isset($v[$n]) && in_array($n, array_keys($this->hasAndBelongsToMany))) { $joined[] = $v; } else { if ($n === $this->alias) {