Skip to content

Instantly share code, notes, and snippets.

Last active Apr 24, 2019
What would you like to do?
Test for the forms id conflict bug
require_once(__DIR__ . '/config.php');
$PAGE->set_url(new moodle_url('/testform.php'));
class testform extends moodleform {
public function definition()
$mform = $this->_form;
$mform->addElement('course', 'courseid');
$form1 = new testform(null, null, 'post', '', ['data-random-ids' => 1]);
$form2 = new testform(null, null, 'post', '', ['data-random-ids' => 1]);
echo $OUTPUT->header();
echo $OUTPUT->footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment