Adding condition inside Controller::render() to avoid storing in the request an empty model definition

This commit is contained in:
Jose Lorenzo Rodriguez 2011-07-17 22:54:11 -04:30
parent 4c8f5ce5be
commit 3594f7aa88

View file

@ -811,7 +811,7 @@ class Controller extends Object {
list($plugin, $className) = pluginSplit($model); list($plugin, $className) = pluginSplit($model);
$this->request->params['models'][$model] = compact('plugin', 'className'); $this->request->params['models'][$model] = compact('plugin', 'className');
} }
} if ($this->uses === false || $this->uses === array()) { } if (!empty($this->modelClass) && ($this->uses === false || $this->uses === array())) {
$this->request->params['models'][$this->modelClass] = array('plugin' => $this->plugin, 'className' => $this->modelClass); $this->request->params['models'][$this->modelClass] = array('plugin' => $this->plugin, 'className' => $this->modelClass);
} }