Skip to content

Commit 4590b7d

Browse files
committed
Merge pull request cakephp#1458 from ravage84/patch-2
Added return before redirects
2 parents 8a81903 + 4a37ad5 commit 4590b7d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Cake/Console/Templates/default/actions/controller_actions.ctp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
5757
<?php if ($wannaUseSession): ?>
5858
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved'));
59-
$this->redirect(array('action' => 'index'));
59+
return $this->redirect(array('action' => 'index'));
6060
<?php else: ?>
6161
$this->flash(__('<?php echo ucfirst(strtolower($currentModelName)); ?> saved.'), array('action' => 'index'));
6262
<?php endif; ?>
@@ -99,7 +99,7 @@
9999
if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
100100
<?php if ($wannaUseSession): ?>
101101
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved'));
102-
$this->redirect(array('action' => 'index'));
102+
return $this->redirect(array('action' => 'index'));
103103
<?php else: ?>
104104
$this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
105105
<?php endif; ?>
@@ -145,7 +145,7 @@
145145
if ($this-><?php echo $currentModelName; ?>->delete()) {
146146
<?php if ($wannaUseSession): ?>
147147
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'));
148-
$this->redirect(array('action' => 'index'));
148+
return $this->redirect(array('action' => 'index'));
149149
<?php else: ?>
150150
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index'));
151151
<?php endif; ?>
@@ -155,5 +155,5 @@
155155
<?php else: ?>
156156
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted'), array('action' => 'index'));
157157
<?php endif; ?>
158-
$this->redirect(array('action' => 'index'));
158+
return $this->redirect(array('action' => 'index'));
159159
}

0 commit comments

Comments
 (0)