MDL-60776 enrol: Fix header for custom fullnamedisplay formats

In case you used a custom fullnamedisplay format that involved anything but spaces (e.g. commas) as delimiters the username header
would be displayed incorrectly and you wouldn't be able to click on the "Firstname" or "Surname" headers to sort according to them.
This commit is contained in:
do-you-even-curl
2018-01-12 09:52:01 +01:00
committed by Sara Arjona
parent 7c9b7feb10
commit 879c847aed
+3 -4
View File
@@ -194,11 +194,10 @@ if ($fullusernames == 'language' || empty($fullusernames)) {
$a->firstname = 'firstname';
$a->lastname = 'lastname';
// Getting the fullname display will ensure that the order in the language file is maintained.
$usernameheader = explode(' ', get_string('fullnamedisplay', null, $a));
} else {
// If everything is as expected then put them in the order specified by the alternative full name format setting.
$usernameheader = order_in_string($allusernames, $fullusernames);
$fullusernames = get_string('fullnamedisplay', null, $a);
}
// If everything is as expected then put them in the order specified by the alternative full name format setting.
$usernameheader = order_in_string($allusernames, $fullusernames);
// Loop through each name and return the language string.
foreach ($usernameheader as $key => $username) {