fix: Fixed missing reason for failure if the freetext import had a single attribute fail during the saving process, fixes #3141

pull/3144/head
iglocska 2018-04-07 23:57:23 +02:00
parent 721cbe1791
commit 1cf495c201
1 changed files with 2 additions and 1 deletions

View File

@ -3649,6 +3649,7 @@ class EventsController extends AppController {
}
$saved++;
} else {
$lastError = $this->Event->$objectType->validationErrors;
$failed++;
}
}
@ -3676,7 +3677,7 @@ class EventsController extends AppController {
}
if ($failed > 0) {
if ($failed == 1) {
$flashMessage = $saved . ' ' . $messageScope . ' created' . $emailResult . '. ' . $failed . ' ' . $messageScope . ' could not be saved. Reason for the failure: ' . json_encode($this->Event->$objectType->validationErrors);
$flashMessage = $saved . ' ' . $messageScope . ' created' . $emailResult . '. ' . $failed . ' ' . $messageScope . ' could not be saved. Reason for the failure: ' . json_encode($lastError);
} else {
$flashMessage = $saved . ' ' . $messageScope . ' created' . $emailResult . '. ' . $failed . ' ' . $messageScope . ' could not be saved. This may be due to attributes with similar values already existing.';
}