Browse Source

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

Jose Lorenzo Rodriguez 14 years ago
parent
commit
3594f7aa88
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Controller/Controller.php

+ 1 - 1
lib/Cake/Controller/Controller.php

@@ -811,7 +811,7 @@ class Controller extends Object {
 				list($plugin, $className) = pluginSplit($model);
 				$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); 
 		}