Last active
April 24, 2019 10:12
-
-
Save marinaglancy/3e2a4210532edd9b7bc870616fc98315 to your computer and use it in GitHub Desktop.
Test for the forms id conflict bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(__DIR__ . '/config.php'); | |
require_once($CFG->libdir.'/formslib.php'); | |
require_login(); | |
$PAGE->set_url(new moodle_url('/testform.php')); | |
$PAGE->set_context(context_system::instance()); | |
class testform extends moodleform { | |
public function definition() | |
{ | |
$mform = $this->_form; | |
$mform->addElement('course', 'courseid'); | |
$this->add_action_buttons(); | |
} | |
} | |
$form1 = new testform(null, null, 'post', '', ['data-random-ids' => 1]); | |
$form2 = new testform(null, null, 'post', '', ['data-random-ids' => 1]); | |
echo $OUTPUT->header(); | |
$form1->display(); | |
$form2->display(); | |
echo $OUTPUT->footer(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment