Merge pull request #3470 from cuppett/master

Fixes #3469, explicit isset check for counterCache
This commit is contained in:
Mark Story 2014-05-11 21:13:55 -04:00
commit 6f08b064a6

View file

@ -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'];
}
}