-
Bug
-
Resolution: Fixed
-
Minor
-
2.9.1
-
MOODLE_29_STABLE
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
MDL-51427-master -
Easy
-
I need to use the 'phone1' field in auth/LDAP for something other than a phone number - Manager's name in this case. However, searching through the 'en' language pack reveals that there is no specific language string for 'phone1'. In fact, 'phone1' uses the language string for 'phone', with the '1' tacked on at the end. This is done in print_auth_lock_options() (in admin/auth_config.php).
The problem with that approach is that changing the language string for 'phone' to 'Manager' results in 'phone1' and 'phone2' fields being labelled 'Manager 1' and Manager 2' respectively. Worse, 'phone' field is now labelled 'Manager' everywhere!
What I want is to be able to change the language string for 'phone1' without affecting 'phone' or 'phone2'.
This is achievable by getting rid of two lines in print_auth_lock_options(), and adding a new language string for 'phone1' to lang/moodle.php:
--- HEAD
|
+++ Modified In Working Tree
|
@@ -146,8 +146,8 @@
|
// If custom field then pick name from database. |
$fieldshortname = str_replace('profile_field_', '', $fieldname); |
$fieldname = $customfieldname[$fieldshortname]->name; |
- } elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) { |
- $fieldname = get_string($matches[1]) . ' ' . $matches[2]; |
+// } elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) { |
+// $fieldname = get_string($matches[1]) . ' ' . $matches[2]; |
} elseif ($fieldname == 'url') { |
$fieldname = get_string('webpage'); |
} else { |
|
and
--- HEAD
|
+++ Modified In Working Tree
|
@@ -1427,6 +1427,7 @@
|
$string['personal'] = 'Personal'; |
$string['personalprofile'] = 'Personal profile'; |
$string['phone'] = 'Phone'; |
+$string['phone1'] = 'Phone 1'; |
$string['phone2'] = 'Mobile phone'; |
$string['phpinfo'] = 'PHP info'; |
$string['pictureof'] = 'Picture of {$a}'; |
|
I found the issue on 2.9.1 (Build: 20150706) but as far as I can tell has been an issue since 1.9.x (e.g. MDL-13151)
- is a regression caused by
-
MDL-13151 Different language string for phone1 and phone2 entries
-
- Closed
-