chg: [internal] SaveMany for Event::add_original_file

pull/7851/head
Jakub Onderka 2021-10-17 19:07:30 +02:00
parent 9e0c36ff2a
commit f99f82fa34
1 changed files with 2 additions and 3 deletions

View File

@ -7218,9 +7218,8 @@ class Event extends AppModel
'disable_correlation' => true
)
);
foreach ($attributes as $attribute) {
$this->Attribute->create();
$this->Attribute->save($attribute);
if (!$this->Attribute->saveMany($attributes)) {
throw new Exception("Could not save attributes for original file because of validation errors:" . json_encode($this->Attribute->validationErrors));
}
return true;
}