mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-10 05:22:41 +00:00
updating scaffold edit
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6053 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
681c449f35
commit
fc10ee7921
1 changed files with 12 additions and 8 deletions
|
@ -259,15 +259,19 @@ class Scaffold extends Object {
|
|||
}
|
||||
|
||||
if ($this->controller->_beforeScaffold($action)) {
|
||||
if ($action == 'edit' && (!isset($params['pass'][0]) || !$this->ScaffoldModel->exists())) {
|
||||
if (isset($this->controller->Session) && $this->controller->Session->valid != false) {
|
||||
$this->controller->Session->setFlash(sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey)));
|
||||
$this->controller->redirect($this->redirect);
|
||||
} else {
|
||||
return $this->controller->flash(sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey)), $this->redirect);
|
||||
if ($action == 'edit') {
|
||||
if(isset($params['pass'][0])) {
|
||||
$this->ScaffoldModel->id = $params['pass'][0];
|
||||
}
|
||||
|
||||
if(!$this->ScaffoldModel->exists()) {
|
||||
if (isset($this->controller->Session) && $this->controller->Session->valid != false) {
|
||||
$this->controller->Session->setFlash(sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey)));
|
||||
$this->controller->redirect($this->redirect);
|
||||
} else {
|
||||
return $this->controller->flash(sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey)), $this->redirect);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'edit') {
|
||||
$this->ScaffoldModel->id = $params['pass'][0];
|
||||
}
|
||||
|
||||
if (!empty($this->controller->data)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue