Wrong version of adminCrudComponent

- Can cause issues when saving roles, replaced with the newer version.
pull/64/merge
Andras Iklody 2013-04-16 09:01:03 +02:00
parent be2d6ae3b9
commit 230d7b4ba1
1 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,7 @@ class AdminCrudComponent extends AuthComponent {
throw new NotFoundException(__(sprintf('Invalid %s', strtolower($this->controller->defaultModel))));
}
if ($this->controller->request->is('post') || $this->controller->request->is('put')) {
$this->controller->request->data[$this->controller->defaultModel]['id'] = $id;
if ($this->controller->{$this->controller->defaultModel}->save($this->controller->request->data)) {
$this->controller->Session->setFlash(__(sprintf('The %s has been saved', strtolower($this->controller->defaultModel))));
$this->controller->redirect(array('action' => 'index'));
@ -57,6 +58,7 @@ class AdminCrudComponent extends AuthComponent {
}
}
} else {
$this->controller->request->data[$this->controller->defaultModel]['id'] = $id;
$this->controller->request->data = Sanitize::clean($this->controller->{$this->controller->defaultModel}->read(null, $id));
}
}