]> git.mjollnir.org Git - moodle.git/commitdiff
get_my_courses() if the parameters passed are identical to the defaults... MDL-7416
authormartinlanghoff <martinlanghoff>
Wed, 16 May 2007 23:19:15 +0000 (23:19 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 16 May 2007 23:19:15 +0000 (23:19 +0000)
We are using the defaults then ;-)

Credits for spotting it go to Yu!
Blames for the thinko to MartinL

lib/datalib.php

index 53ec22c98b611c55fb567b3c5b45f6cbcf919a8c..9a9df1d6d5c00351c2c4d6326543444862198aef 100644 (file)
@@ -689,12 +689,12 @@ function get_my_courses($userid, $sort=NULL, $fields=NULL, $doanything=false,$li
     $d_fields = 'id, category, sortorder, shortname, fullname, idnumber, newsitems, teacher, teachers, student, students, guest, startdate, visible, cost, enrol, summary, groupmode, groupmodeforce';
 
     $usingdefaults = true;
-    if (is_null($sort)) {
+    if (is_null($sort)   || $sort === $d_sort) {
         $sort = $d_sort;
     } else {
         $usingdefaults = false;
     }
-    if (is_null($fields)) {
+    if (is_null($fields) || $fields === $d_fields) {
         $fields = $d_fields;
     } else {
         $usingdefaults = false;