Skip to content

Commit

Permalink
Fixing plugin prefix handling when using plugin task to bake plugin c…
Browse files Browse the repository at this point in the history
…ontrollers. 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
  • Loading branch information
markstory committed Jun 17, 2009
1 parent 1ea5f94 commit a2a7727
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cake/console/libs/tasks/controller.php
Expand Up @@ -243,8 +243,11 @@ function __interactive($controllerName = false) {
* @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;
}
Expand Down

0 comments on commit a2a7727

Please sign in to comment.