Block Plugins on Courses

Re: Block Plugins on Courses

by Davo Smith -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The form built in to this plugin isn't checking to see what parameters were included in the current page URL. The code for the form will need updating so that it detects these parameters and makes sure that they are included as 'hidden' fields in the form.

The required code would look something like this (in the form's definition() function, assuming the form is using a standard Moodle form for the content):

global $PAGE;
foreach ($PAGE->params() as $name => $value) {
$mform->addElement('hidden', $name, $value);
$mform->setType($name, PARAM_RAW);
}