From 048dc8d254bbb96180545dad6040521fde12b3cf Mon Sep 17 00:00:00 2001 From: Ceeram Date: Sat, 2 Jun 2012 01:39:53 +0200 Subject: [PATCH] casting schema to array, fixes error for array_keys when return is null --- lib/Cake/Model/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 2eecea436..a2bf2a588 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -1166,7 +1166,7 @@ class Model extends Object implements CakeEventListener { */ protected function _setAliasData($data) { $models = array_keys($this->getAssociated()); - $schema = array_keys($this->schema()); + $schema = array_keys((array)$this->schema()); foreach ($data as $field => $value) { if (in_array($field, $schema) || !in_array($field, $models)) { $data[$this->alias][$field] = $value;