Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marxjohnson/3225798 to your computer and use it in GitHub Desktop.
Save marxjohnson/3225798 to your computer and use it in GitHub Desktop.
Patch for Moodle 2 to remove requirement from city and country fields in user profile. Copyright Richard Taunton Sixth Form College, UK. Licenced under GNU GPL.
From c106c6188887b169a237a2e14b675dab9e1aa777 Mon Sep 17 00:00:00 2001
From: Mark Johnson <mark.johnson@tauntons.ac.uk>
Date: Mon, 12 Sep 2011 13:46:00 +0100
Subject: [PATCH 51/78] Removed requirement from city and country fields in
user profile
---
user/editlib.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/user/editlib.php b/user/editlib.php
index 36836bd..699413c 100644
--- a/user/editlib.php
+++ b/user/editlib.php
@@ -218,7 +218,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$mform->addElement('text', 'city', get_string('city'), 'maxlength="120" size="21"');
$mform->setType('city', PARAM_MULTILANG);
- $mform->addRule('city', $strrequired, 'required', null, 'client');
+ //$mform->addRule('city', $strrequired, 'required', null, 'client');
if (!empty($CFG->defaultcity)) {
$mform->setDefault('city', $CFG->defaultcity);
}
@@ -226,7 +226,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$choices = get_string_manager()->get_list_of_countries();
$choices= array(''=>get_string('selectacountry').'...') + $choices;
$mform->addElement('select', 'country', get_string('selectacountry'), $choices);
- $mform->addRule('country', $strrequired, 'required', null, 'client');
+ //$mform->addRule('country', $strrequired, 'required', null, 'client');
if (!empty($CFG->country)) {
$mform->setDefault('country', $CFG->country);
}
--
1.7.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment