Skip to content

Commit

Permalink
Accessibility: Required form fields should use default message not 'R…
Browse files Browse the repository at this point in the history
…equired' #768430
  • Loading branch information
sammarshallou committed May 20, 2024
1 parent 8f14d1e commit 8c4042a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions comment_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function definition() {
$mform->addElement('text', 'authorname',
get_string('moderated_authorname', 'oublog'), 'size="48"');
$mform->setType('authorname', PARAM_TEXT);
$mform->addRule('authorname', get_string('required'), 'required', null, 'client');
$mform->addRule('authorname', null, 'required', null, 'client');
}

$mform->addElement('text', 'title', get_string('title', 'oublog'), 'size="48"');
Expand All @@ -67,7 +67,7 @@ public function definition() {
array('cols' => 50, 'rows' => 30),
array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $maxbytes));
$mform->setType('messagecomment', PARAM_CLEANHTML);
$mform->addRule('messagecomment', get_string('required'), 'required', null, 'server');
$mform->addRule('messagecomment', null, 'required', null, 'server');

// When using moderation, we include the world's dumbest capcha (the
// user is told to type 'yes' into the box). Because there is moderation
Expand Down
6 changes: 3 additions & 3 deletions link_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public function definition() {

$mform->addElement('text', 'title', get_string('title', 'oublog'), 'size="48"');
$mform->setType('title', PARAM_TEXT);
$mform->addRule('title', get_string('required'), 'required', null, 'client');
$mform->addRule('title', null, 'required', null, 'client');

$mform->addElement('text', 'url', get_string('url', 'oublog'), 'size="48"');
$mform->setType('url', PARAM_URL);
$mform->addRule('url', get_string('required'), 'required', null, 'client');
$mform->addRule('url', null, 'required', null, 'client');

if ($edit) {
$submitstring = get_string('savechanges');
Expand All @@ -57,4 +57,4 @@ public function definition() {
$mform->setType('cmid', PARAM_INT);

}
}
}
4 changes: 2 additions & 2 deletions post_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function definition() {
$mform->addElement('editor', 'message', get_string('message', 'oublog'),
array('cols' => 50, 'rows' => 30),
array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $maxbytes));
$mform->addRule('message', get_string('required'), 'required', null, 'client');
$mform->addRule('message', null, 'required', null, 'client');

if ($this->restricttags) {
$mform->addElement('static', 'restricttagswarning', '', get_string('restricttagslist', 'oublog', implode(',', $atags)));
Expand All @@ -77,7 +77,7 @@ public function definition() {
$mform->setDefault('tags', $tagslist);
}
if ($this->requiretags) {
$mform->addRule('tags', get_string('required'), 'required', null, 'client');
$mform->addRule('tags', null, 'required', null, 'client');
}

$options = array();
Expand Down

0 comments on commit 8c4042a

Please sign in to comment.