Merged fixes from [3906]

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3907 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-11-22 20:08:53 +00:00
parent 3180035f0f
commit b76c2179e1
2 changed files with 9 additions and 2 deletions

View file

@ -298,6 +298,7 @@ class Controller extends Object {
if ($this->persistModel === true){
loadModels();
uses('neat_array');
} elseif($this->uses === false) {
loadModel($this->modelClass);
}
@ -335,7 +336,10 @@ class Controller extends Object {
$cached = false;
$object = null;
$modelKey = Inflector::underscore($modelClass);
loadModel($modelClass);
if(!class_exists($modelClass)){
loadModel($modelClass);
}
if (class_exists($modelClass)) {
if ($this->persistModel === true) {

View file

@ -570,7 +570,10 @@ class Model extends Overloadable {
*/
function __constructLinkedModel($assoc, $className, $id = false, $table = null, $ds = null) {
$colKey = Inflector::underscore($className);
loadModel($className);
if(!class_exists($className)){
loadModel($className);
}
if (ClassRegistry::isKeySet($colKey)) {
if (!PHP5) {