mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding redirect to baked controllers so when no delete could be done an
error page is not displayed. Fixes #188 Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
11a5403aaf
commit
5149d65c7e
1 changed files with 6 additions and 0 deletions
|
@ -386,6 +386,12 @@ class ControllerTask extends Shell {
|
|||
$actions .= "\t\t\t\$this->flash(__('{$singularHumanName} deleted', true), array('action' => 'index'));\n";
|
||||
}
|
||||
$actions .= "\t\t}\n";
|
||||
if ($wannaUseSession) {
|
||||
$actions .= "\t\t\$this->Session->setFlash(__('The {$singularHumanName} could not be deleted. Please, try again.', true));\n";
|
||||
$actions .= "\t\t\$this->redirect(array('action' => 'index'));\n";
|
||||
} else {
|
||||
$actions .= "\t\t\$this->flash(__('The {$singularHumanName} could not be deleted. Please, try again.', true), array('action' => 'index'));\n";
|
||||
}
|
||||
$actions .= "\t}\n";
|
||||
$actions .= "\n";
|
||||
return $actions;
|
||||
|
|
Loading…
Add table
Reference in a new issue