From 38f578199de3ff6b6debbe8c17d73762354fd6d0 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 12 Nov 2009 09:32:45 -0500 Subject: [PATCH] Changing new Model() for ClassRegistry::init(). Fixes issues when baking admin and non-admin methods for a controller that uses bound translations + TranslateBehavior. Fixes #245 --- cake/console/libs/tasks/controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index efc36310603..c49735ed8ed 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -252,7 +252,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { exit; } $actions = null; - $modelObj =& new $currentModelName(); + $modelObj =& ClassRegistry::init($currentModelName); $controllerPath = $this->_controllerPath($controllerName); $pluralName = $this->_pluralName($currentModelName); $singularName = Inflector::variable($currentModelName);