From 7edcdb0799520904c5d1c7ad97e6057e249a99e5 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Just Date: Sat, 9 Jul 2016 16:08:16 +0100 Subject: [PATCH] Handle plugin association consistently --- lib/Cake/Model/Model.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index ccbae1789..660043040 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -1035,13 +1035,13 @@ class Model extends Object implements CakeEventListener { unset($association[$assoc]); $assoc = $value; $value = array(); - - if (strpos($assoc, '.') !== false) { - list($plugin, $assoc) = pluginSplit($assoc, true); - $association[$assoc] = array('className' => $plugin . $assoc); - } else { - $association[$assoc] = $value; - } + $association[$assoc] = $value; + } + + if (!isset($value['className']) && strpos($assoc, '.') !== false) { + unset($association[$assoc]); + list($plugin, $assoc) = pluginSplit($assoc, true); + $association[$assoc] = array('className' => $plugin . $assoc) + $value; } $this->_generateAssociation($type, $assoc);