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
This commit is contained in:
mark_story 2009-06-17 02:17:18 +00:00
parent 1ea5f94c29
commit a2a7727c00

View file

@ -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;
}