mirror of https://github.com/MISP/MISP
fix: [enrichment] Json format of validation errors
parent
a5a1fab835
commit
2692efd265
|
@ -6059,7 +6059,7 @@ class Event extends AppModel
|
|||
}
|
||||
if ($failed_attributes > 0) {
|
||||
if ($failed_attributes == 1) {
|
||||
$reason = ' attribute could not be saved. Reason for the failure: ' . $lastAttributeError['value'] . ' ';
|
||||
$reason = ' attribute could not be saved. Reason for the failure: ' . json_encode($lastAttributeError) . ' ';
|
||||
} else {
|
||||
$reason = ' attributes could not be saved. This may be due to attributes with similar values already existing. ';
|
||||
}
|
||||
|
@ -6079,7 +6079,7 @@ class Event extends AppModel
|
|||
} else {
|
||||
$reason = ' objects could not be saved. An example of reason for the failure: ';
|
||||
}
|
||||
$message .= $failed_objects . $reason . $lastObjectError['value'] . ' ';
|
||||
$message .= $failed_objects . $reason . json_encode($lastObjectError) . ' ';
|
||||
}
|
||||
if ($failed_object_attributes > 0) {
|
||||
if ($failed_object_attributes == 1) {
|
||||
|
@ -6087,7 +6087,7 @@ class Event extends AppModel
|
|||
} else {
|
||||
$reason = 'object attributes could not be saved. An example of reason for the failure: ';
|
||||
}
|
||||
$message .= 'By the way, ' . $failed_object_attributes . $reason . $lastObjectAttributeError['value'] . '.';
|
||||
$message .= 'By the way, ' . $failed_object_attributes . $reason . json_encode($lastObjectAttributeError) . '.';
|
||||
}
|
||||
if (!empty($reference_errors)) {
|
||||
$reference_error = sizeof($reference_errors) == 1 ? 'a reference is' : 'some references are';
|
||||
|
|
Loading…
Reference in New Issue