Details
-
Bug
-
Resolution: Won't Do
-
Trivial
-
None
-
2.5.1
-
MOODLE_25_STABLE
-
Description
clean_param() is always called before addrule() validations are checked in mforms
For example :-
$mform->addElement('text', 'config_appid', get_string('appid', 'block_fbcomments'));
|
$mform->addHelpButton("config_appid", "appid", "block_fbcomments");
|
$mform->addRule('config_appid', get_string("notnumeric", "block_fbcomments"), "numeric", null, "server");
|
$mform->setType('config_appid', PARAM_INT);
|
$mform->disabledIf('config_appid', 'config_enablecomment', 'notchecked');
|
Will accept "test" as appid, since setype filters it and converts it to 0, which is then passed to add rule() which validates it as correct.
However if you try doing the same thing without "settype", you get an error, since the "test" is not numeric.
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-40267 Add maxlength rule in moodle form doesn't support utf8
-
- Closed
-