From d6fa8c3f393245b15e567924dcced7d3956faa84 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 5 May 2015 10:11:51 +1200 Subject: [PATCH] Tidy up some debug messages. --- duration_form.php | 3 +++ sessions.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/duration_form.php b/duration_form.php index 92877ba..3051642 100644 --- a/duration_form.php +++ b/duration_form.php @@ -61,8 +61,11 @@ class mod_attendance_duration_form extends moodleform { $mform->addGroup($durselect, 'durtime', get_string('newduration', 'attendance'), array(' '), true); $mform->addElement('hidden', 'ids', $ids); + $mform->setType('ids', PARAM_ALPHANUMEXT); $mform->addElement('hidden', 'id', $cm->id); + $mform->setType('id', PARAM_INT); $mform->addElement('hidden', 'action', att_sessions_page_params::ACTION_CHANGE_DURATION); + $mform->setType('action', PARAM_INT); $mform->setDefaults(array('durtime' => array('hours'=>0, 'minutes'=>0))); diff --git a/sessions.php b/sessions.php index fda84fe..f44d060 100644 --- a/sessions.php +++ b/sessions.php @@ -119,7 +119,7 @@ switch ($att->pageparams->action) { } redirect($att->url_manage(), get_string('sessiondeleted', 'attendance')); } - $sessid = required_param('sessid', PARAM_SEQUENCE); + $sessid = required_param_array('sessid', PARAM_SEQUENCE); $sessionsinfo = $att->get_sessions_info($sessid); @@ -142,10 +142,10 @@ switch ($att->pageparams->action) { echo $OUTPUT->footer(); exit; case att_sessions_page_params::ACTION_CHANGE_DURATION: - $sessid = optional_param('sessid', '', PARAM_SEQUENCE); + $sessid = optional_param_array('sessid', '', PARAM_SEQUENCE); $ids = optional_param('ids', '', PARAM_ALPHANUMEXT); - $slist = isset($sessid) ? implode('_', $sessid) : ''; + $slist = !empty($sessid) ? implode('_', $sessid) : ''; $url = $att->url_sessions(array('action' => att_sessions_page_params::ACTION_CHANGE_DURATION)); $formparams['ids'] = $slist;