Incorrect flash message on successfu freetext import fixed, fixes #322

pull/375/head
iglocska 2014-11-25 13:40:24 +01:00
parent 9e8803c6eb
commit 7c6000ec21
1 changed files with 5 additions and 1 deletions

View File

@ -2860,7 +2860,11 @@ class EventsController extends AppController {
$event['Event']['published'] = 0;
$this->Event->save($event);
}
$this->Session->setFlash($saved . ' attributes created. ' . $failed . ' attributes could not be saved. This may be due to attributes with similar values already existing.');
if ($failed > 0) {
$this->Session->setFlash($saved . ' attributes created. ' . $failed . ' attributes could not be saved. This may be due to attributes with similar values already existing.');
} else {
$this->Session->setFlash($saved . ' attributes created.');
}
$this->redirect(array('controller' => 'events', 'action' => 'view', $id));
} else {
throw new MethodNotAllowedException();