fix: [beforesave] hook removed on get requests

cli-modification-summary
iglocska 2022-11-11 15:08:23 +01:00
parent 5b07e3e530
commit c2bff49185
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 0 additions and 6 deletions

View File

@ -787,12 +787,6 @@ class CRUDComponent extends Component
if (empty($data)) {
throw new NotFoundException(__('Invalid {0}.', $this->ObjectAlias));
}
if (isset($params['beforeSave'])) {
$data = $params['beforeSave']($data);
if ($data === false) {
throw new NotFoundException(__('Could not save {0} due to the input failing to meet expectations. Your input is bad and you should feel bad.', $this->ObjectAlias));
}
}
$this->Controller->set('id', $data['id']);
$this->Controller->set('data', $data);
$this->Controller->set('bulkEnabled', false);