From fb0053753e2629b3553fbaa1ba04b0eb78585467 Mon Sep 17 00:00:00 2001 From: Ceeram Date: Wed, 22 Aug 2012 13:03:47 +0200 Subject: [PATCH] avoid duplication in returned results for habtm --- lib/Cake/Model/Model.php | 2 +- lib/Cake/Test/Case/Model/ModelWriteTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index c95ff26a8..c85dd85ca 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -1755,7 +1755,7 @@ class Model extends Object implements CakeEventListener { $this->getEventManager()->dispatch($event); } if (!empty($this->data)) { - $success = Hash::merge($success, $this->data); + $success = array_merge($success, $this->data); } $this->data = false; $this->_clearCache(); diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index fe8714ee9..d46a6db27 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -1170,6 +1170,7 @@ class ModelWriteTest extends BaseModelTest { $this->assertFalse(empty($result)); $result = $TestModel->save(); $this->assertFalse(empty($result)); + $this->assertEquals($data['Tag'], $result['Tag']); $TestModel->unbindModel(array('belongsTo' => array('User'), 'hasMany' => array('Comment'))); $result = $TestModel->find('first', array('fields' => array('id', 'user_id', 'title', 'body'), 'conditions' => array('Article.id' => 2)));