From 879c847aed307a401eb2bccfdcdad036202437a1 Mon Sep 17 00:00:00 2001 From: do-you-even-curl Date: Thu, 7 Dec 2017 14:01:48 +0100 Subject: [PATCH] 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. --- enrol/users.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/enrol/users.php b/enrol/users.php index 403121d876b..04c2b805320 100644 --- a/enrol/users.php +++ b/enrol/users.php @@ -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) {