diff --git a/framework/yii/base/Module.php b/framework/yii/base/Module.php index a7aa387..0e5c592 100644 --- a/framework/yii/base/Module.php +++ b/framework/yii/base/Module.php @@ -539,15 +539,10 @@ abstract class Module extends Component public function setComponents($components) { foreach ($components as $id => $component) { - if (isset($this->_components[$id]) && !($this->_components[$id] instanceof Object)) { - if (isset($this->_components[$id]['class']) && !isset($component['class'])) { - $component['class'] = $this->_components[$id]['class']; - } - $this->_components[$id] = $component; - } - else { - throw new Exception('Cannot set component "'.$id.'" that is already instantiated.'); + if (isset($this->_components[$id]['class']) && !isset($component['class'])) { + $component['class'] = $this->_components[$id]['class']; } + $this->_components[$id] = $component; } }