From a2a7727c00568c4f5a52ad9aaec0cc41cda55ee6 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 17 Jun 2009 02:17:18 +0000 Subject: [PATCH] Fixing plugin prefix handling when using plugin task to bake plugin controllers. Plugin Models are correctly found, allowing bake to work. Fixes #5069 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8199 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/console/libs/tasks/controller.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index aefe126ea..b4a98756d 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -243,8 +243,11 @@ class ControllerTask extends Shell { * @access private */ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { - $currentModelName = $this->_modelName($controllerName); - if (!App::import('Model', $currentModelName)) { + $currentModelName = $modelImport = $this->_modelName($controllerName); + if ($this->plugin) { + $modelImport = $this->plugin . '.' . $modelImport; + } + if (!App::import('Model', $modelImport)) { $this->err(__('You must have a model for this class to build scaffold methods. Please try again.', true)); exit; }