MDL-39422 mod_forms: prevent long coruse module names

To prevent ugly DB errors.
This commit is contained in:
Dan Poltawski
2013-04-30 17:42:03 +01:00
parent da7b1ecb12
commit 41b2eb8400
18 changed files with 18 additions and 0 deletions
+1
View File
@@ -22,6 +22,7 @@ class mod_data_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true, get_string('intro', 'data'));