Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-24530 Fixed core functions usage during early install phase when …

…the site is not fully set up yet
  • Loading branch information...
commit ee8dd77f754a3ff9e23b36f19a9235222bc4f1b9 1 parent ec7e6c6
@mudrd8mz mudrd8mz authored
Showing with 5 additions and 4 deletions.
  1. +4 −2 lib/adminlib.php
  2. +1 −2  lib/moodlelib.php
View
6 lib/adminlib.php
@@ -2605,8 +2605,10 @@ function load_choices() {
'$@NONE@$' => get_string('nobody'),
'$@ALL@$' => get_string('everyonewhocan', 'admin', get_capability_string($this->capability)),
);
- foreach ($users as $user) {
- $this->choices[$user->username] = fullname($user);
+ if (is_array($users)) {
+ foreach ($users as $user) {
+ $this->choices[$user->username] = fullname($user);
+ }
}
return true;
}
View
3  lib/moodlelib.php
@@ -2683,7 +2683,6 @@ function ismoving($courseid) {
* @param bool $override If true then the name will be first name followed by last name rather than adhering to fullnamedisplay setting.
*/
function fullname($user, $override=false) {
-
global $CFG, $SESSION;
if (!isset($user->firstname) and !isset($user->lastname)) {
@@ -2703,7 +2702,7 @@ function fullname($user, $override=false) {
$CFG->fullnamedisplay = $SESSION->fullnamedisplay;
}
- if ($CFG->fullnamedisplay == 'firstname lastname') {
+ if (!isset($CFG->fullnamedisplay) or $CFG->fullnamedisplay === 'firstname lastname') {
return $user->firstname .' '. $user->lastname;
} else if ($CFG->fullnamedisplay == 'lastname firstname') {
Please sign in to comment.
Something went wrong with that request. Please try again.