fix: [eventReport:editReport] Generate an UUID if new report added from pull

pull/9570/head
Sami Mokaddem 2023-12-14 10:59:49 +01:00
parent 79846fa314
commit 618dbb64cf
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 6 additions and 2 deletions

View File

@ -153,8 +153,12 @@ class EventReport extends AppModel
{
$errors = array();
if (!isset($report['EventReport']['uuid'])) {
$errors[] = __('Event Report doesn\'t have an UUID');
return $errors;
if ($fromPull) {
$report['EventReport']['uuid'] = $attribute['uuid'] = CakeText::uuid();
} else {
$errors[] = __('Event Report doesn\'t have an UUID');
return $errors;
}
}
$report['EventReport']['event_id'] = $eventId;
$existingReport = $this->find('first', array(