MDL-33143 wiki-2.0 : wiki edit form will have mform1 as id for JS to work
authorRajesh Taneja <rajesh@moodle.com>
Tue, 22 May 2012 05:11:23 +0000 (13:11 +0800)
committerRajesh Taneja <rajesh@moodle.com>
Wed, 23 May 2012 04:50:45 +0000 (12:50 +0800)
mod/wiki/edit_form.php

index b213a94..9992dde 100644 (file)
@@ -39,6 +39,9 @@ class mod_wiki_edit_form extends moodleform {
         global $CFG;
 
         $mform = $this->_form;
+        // BEWARE HACK: In order for things to work we need to override the form id and set it to mform1.
+        // The first form to be instantiated never gets displayed so this should be safe.
+        $mform->updateAttributes(array('id' => 'mform1'));
 
         $version = $this->_customdata['version'];
         $format = $this->_customdata['format'];