From 2b7024847d8aa1faaeea2746b7157106fb06df63 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Tue, 18 Sep 2012 11:17:18 +0800 Subject: [PATCH] MDL-35427: Remove resetting of $_POST - use $mform->setConstant to force update to rownum instead. Conflicts: mod/assign/locallib.php --- mod/assign/locallib.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index e1e5104a043..5ca90c25175 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -1629,11 +1629,7 @@ class assign { if ($rownum == count($useridlist) - 1) { $last = true; } - // the placement of this is important so can pass the list of userids above - if ($offset) { - $_POST = array(); - } - if(!$userid){ + if (!$userid) { throw new coding_exception('Row is out of bounds for the current grading table: ' . $rownum); } $user = $DB->get_record('user', array('id' => $userid)); @@ -2941,6 +2937,7 @@ class assign { $mform->setType('id', PARAM_INT); $mform->addElement('hidden', 'rownum', $rownum); $mform->setType('rownum', PARAM_INT); + $mform->setConstant('rownum', $rownum); $mform->addElement('hidden', 'useridlist', implode(',', $useridlist)); $mform->setType('useridlist', PARAM_TEXT); $mform->addElement('hidden', 'ajax', optional_param('ajax', 0, PARAM_INT));