Adding patch from , fixes Scaffold plugin produces incorrect form "action"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5142 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-05-21 04:27:42 +00:00
parent ce66c9863e
commit 1db295f366

View file

@ -142,9 +142,7 @@ class FormHelper extends AppHelper {
if (empty($options['url']) || is_array($options['url'])) { if (empty($options['url']) || is_array($options['url'])) {
$options = (array)$options; $options = (array)$options;
if(!empty($this->plugin)) { if (!empty($model) && $model != $defaultModel) {
$controller = $this->plugin;
} elseif (!empty($model) && $model != $defaultModel) {
$controller = Inflector::underscore(Inflector::pluralize($model)); $controller = Inflector::underscore(Inflector::pluralize($model));
} else { } else {
$controller = Inflector::underscore($this->params['controller']); $controller = Inflector::underscore($this->params['controller']);
@ -154,6 +152,7 @@ class FormHelper extends AppHelper {
} }
$actionDefaults = array( $actionDefaults = array(
'plugin' => $this->plugin,
'controller' => $controller, 'controller' => $controller,
'action' => $options['action'], 'action' => $options['action'],
'id' => $id 'id' => $id