Merge branch 'main' into develop

pull/85/head
iglocska 2022-01-18 16:25:01 +01:00
commit 362045f798
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 9 additions and 15 deletions

View File

@ -467,24 +467,18 @@ class CRUDComponent extends Component
if (!empty($params['contain'])) { if (!empty($params['contain'])) {
$data->contain($params['contain']); $data->contain($params['contain']);
} }
$data = $data->first();
if (isset($params['beforeSave'])) { if (isset($params['beforeSave'])) {
$data = $params['beforeSave']($data); $data = $params['beforeSave']($data);
if ($data === false) {
$skipExecution = true;
$success = false;
}
} }
if (!$skipExecution) { if (!empty($data)) {
$data = $data->first(); $success = $this->Table->delete($data);
if (!empty($data)) { $success = true;
$success = $this->Table->delete($data); } else {
$success = true; $success = false;
} else { }
$success = false; if ($success) {
} $bulkSuccesses++;
if ($success) {
$bulkSuccesses++;
}
} }
} }
$message = $this->getMessageBasedOnResult( $message = $this->getMessageBasedOnResult(