Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
David Mudrák authored October 06, 2010
6  lib/adminlib.php
@@ -2605,8 +2605,10 @@ function load_choices() {
2605 2605
             '$@NONE@$' => get_string('nobody'),
2606 2606
             '$@ALL@$' => get_string('everyonewhocan', 'admin', get_capability_string($this->capability)),
2607 2607
         );
2608  
-        foreach ($users as $user) {
2609  
-            $this->choices[$user->username] = fullname($user);
  2608
+        if (is_array($users)) {
  2609
+            foreach ($users as $user) {
  2610
+                $this->choices[$user->username] = fullname($user);
  2611
+            }
2610 2612
         }
2611 2613
         return true;
2612 2614
     }
3  lib/moodlelib.php
@@ -2683,7 +2683,6 @@ function ismoving($courseid) {
2683 2683
  * @param bool $override If true then the name will be first name followed by last name rather than adhering to fullnamedisplay setting.
2684 2684
  */
2685 2685
 function fullname($user, $override=false) {
2686  
-
2687 2686
     global $CFG, $SESSION;
2688 2687
 
2689 2688
     if (!isset($user->firstname) and !isset($user->lastname)) {
@@ -2703,7 +2702,7 @@ function fullname($user, $override=false) {
2703 2702
         $CFG->fullnamedisplay = $SESSION->fullnamedisplay;
2704 2703
     }
2705 2704
 
2706  
-    if ($CFG->fullnamedisplay == 'firstname lastname') {
  2705
+    if (!isset($CFG->fullnamedisplay) or $CFG->fullnamedisplay === 'firstname lastname') {
2707 2706
         return $user->firstname .' '. $user->lastname;
2708 2707
 
2709 2708
     } else if ($CFG->fullnamedisplay == 'lastname firstname') {

0 notes on commit ee8dd77

Please sign in to comment.
Something went wrong with that request. Please try again.