From ed83df5bedec77a300336ff7f0150aef280afa15 Mon Sep 17 00:00:00 2001 From: Stephen Cuppett Date: Sun, 11 May 2014 19:17:18 -0400 Subject: [PATCH] Fixes #3469, explicit isset check for counterCache --- 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 746b2e03c..63fea7f1e 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -2106,7 +2106,7 @@ class Model extends Object implements CakeEventListener { protected function _prepareUpdateFields($data) { $foreignKeys = array(); foreach ($this->belongsTo as $assoc => $info) { - if ($info['counterCache']) { + if (isset($info['counterCache']) && $info['counterCache']) { $foreignKeys[$assoc] = $info['foreignKey']; } }