Moving to GitHub.
[platal.git] / include / profilefields.inc.php
index 96502f8..8a3ace0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -376,7 +376,7 @@ class ProfileMedals extends ProfileField
 
     public static function fetchData(array $pids, Visibility $visibility)
     {
-        $data = XDB::iterator('SELECT  pm.pid, pm.mid, pm.gid, pme.text, pme.img, pmge.text AS grade
+        $data = XDB::iterator('SELECT  pm.pid, pm.mid, pm.gid, pme.text, pme.img, pmge.text AS grade, pm.level
                                  FROM  profile_medals AS pm
                             LEFT JOIN  profiles AS p ON (pm.pid = p.pid)
                             LEFT JOIN  profile_medal_enum AS pme ON (pme.id = pm.mid)
@@ -875,7 +875,7 @@ class CompanyList
 
     static public function get($id)
     {
-        if (!array_key_exists($id, self::$companies)) {
+        if (!is_null($id) && !array_key_exists($id, self::$companies)) {
             self::preload();
         }
         if (isset(self::$companies[$id])) {
@@ -886,5 +886,5 @@ class CompanyList
 }
 // }}}
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>