Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing plugin prefix handling when using plugin task to bake plugin c…

…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...
commit a2a7727c00568c4f5a52ad9aaec0cc41cda55ee6 1 parent 1ea5f94
@markstory markstory authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 cake/console/libs/tasks/controller.php
View
7 cake/console/libs/tasks/controller.php
@@ -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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.