fix: [enrichment] Json format of validation errors

pull/4584/head
chrisr3d 2019-05-02 11:41:12 +02:00
parent a5a1fab835
commit 2692efd265
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 3 additions and 3 deletions

View File

@ -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';