MDL-52843 users: Fix the PARAM type of the name fields in signup form
authorDavid Mudrák <david@moodle.com>
Tue, 19 Jan 2016 16:00:59 +0000 (17:00 +0100)
committerDavid Mudrák <david@moodle.com>
Wed, 20 Jan 2016 10:17:32 +0000 (11:17 +0100)
If editing the profile, the useredit_shared_definition() function set
the type of all name fields to PARAM_NOTAGS. This patch sets that type
consistently in the user signup form, too.

login/signup_form.php

index 2d43f70..a463e9d 100644 (file)
@@ -63,7 +63,7 @@ class login_signup_form extends moodleform {
         $namefields = useredit_get_required_name_fields();
         foreach ($namefields as $field) {
             $mform->addElement('text', $field, get_string($field), 'maxlength="100" size="30"');
-            $mform->setType($field, PARAM_TEXT);
+            $mform->setType($field, PARAM_NOTAGS);
             $stringid = 'missing' . $field;
             if (!get_string_manager()->string_exists($stringid, 'moodle')) {
                 $stringid = 'required';