Fix issue #159 - Delete no selected sessions
authorBarry Oosthuizen <barry.oosthuizen@nottingham.ac.uk>
Wed, 23 Sep 2015 08:52:13 +0000 (09:52 +0100)
committerBarry Oosthuizen <barry.oosthuizen@nottingham.ac.uk>
Wed, 23 Sep 2015 08:53:46 +0000 (09:53 +0100)
sessions.php

index 2aac736..0852710 100644 (file)
@@ -131,8 +131,10 @@ switch ($att->pageparams->action) {
             }
             redirect($att->url_manage(), get_string('sessiondeleted', 'attendance'));
         }
-        $sessid = required_param_array('sessid', PARAM_SEQUENCE);
-
+        $sessid = optional_param_array('sessid', '', PARAM_SEQUENCE);
+        if (empty($sessid)) {
+            print_error('nosessionsselected', 'attendance', $att->url_manage());
+        }
         $sessionsinfo = $att->get_sessions_info($sessid);
 
         $message = get_string('deletecheckfull', '', get_string('session', 'attendance'));