chg: [internal] Potential fix for a race condition generating orphaned attributes, fixes #4886

- This fix will avoid issues where the delay is introduced by the deferred start of the execution via the background workers
- deleting an event whilst data is being actively added will still not be interrupted
pull/4965/head
iglocska 2019-08-05 15:50:34 +02:00
parent 76ce771376
commit 47ae244514
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 6 additions and 0 deletions

View File

@ -4120,6 +4120,9 @@ class Event extends AppModel
$this->id = $id;
$this->recursive = 0;
$event = $this->read(null, $id);
if (empty($event)) {
return false;
}
if ($jobId) {
$this->Behaviors->unload('SysLogLogable.SysLogLogable');
} else {
@ -6012,6 +6015,9 @@ class Event extends AppModel
'recursive' => -1,
'fields' => array('orgc_id', 'id', 'distribution', 'published', 'uuid'),
));
if (empty($event)) {
return false;
}
$results = array();
if (!$user['Role']['perm_site_admin'] && !empty($event) && $event['Event']['orgc_id'] != $user['org_id']) {
$objectType = 'ShadowAttribute';