fix: [enrichment] Redefinition of the '$failed' array

- Used as list and not as dict
- Used to keep a list of failing attribute & objects
- Attributes already present in the event are no
  longer saved in this list, and their uuid is saved
  in the '$recovered_uuids' list which is used to
  redirect the resolved attribute / object uuid to
  the same already present attribute / object
pull/4584/head
chrisr3d 2019-04-23 16:26:16 +02:00
parent 5437593c4d
commit 8eb6993065
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 2 additions and 1 deletions

View File

@ -5844,7 +5844,6 @@ class Event extends AppModel
} else {
$failed_attributes++;
$lastAttributeError = $this->Attribute->validationErrors;
$failed[$attribute['uuid']] = array('Attribute' => $attribute);
$original_uuid = $this->Object->Attribute->find('first', array(
'conditions' => array('Attribute.event_id' => $id, 'Attribute.object_id' => 0, 'Attribute.deleted' => 0,
'Attribute.type' => $attribute['type'], 'Attribute.value' => $attribute['value']),
@ -5853,6 +5852,8 @@ class Event extends AppModel
));
if (!empty($original_uuid)) {
$recovered_uuids[$attribute['uuid']] = $original_uuid['Attribute']['uuid'];
} else {
$failed[] = $attribute['uuid'];
}
}
if ($jobId) {