Skip to content

Commit

Permalink
Error message for batch action without items
Browse files Browse the repository at this point in the history
  • Loading branch information
ivank committed Aug 25, 2014
1 parent 6dd3c30 commit 4743a12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/Kohana/Controller/Tart/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public function action_batch()
$ids = $this->request->post('id') ?: $this->request->query('id');
$action = $this->request->post('action') ?: $this->request->query('action');

if ( ! $ids) {
$this->notify('error', 'No items selected');
$this->redirect($this->request->referrer() ?: Tart::uri($this->request->controller()));
}

$this->{'batch_'.$action}($ids);
}

Expand Down

0 comments on commit 4743a12

Please sign in to comment.