From: piers Date: Sun, 27 Jul 2008 21:19:01 +0000 (+0000) Subject: MDL-11137 Unable to locate API error - add check for empty array from DB interface... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=07b905ae55268b81c61e4737be433d0ce8bd1dbd;p=moodle.git MDL-11137 Unable to locate API error - add check for empty array from DB interface (ksort complains), change deprecated get_records_select_menu() deprecated call. --- diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 487b5f0dcd..91e3f80c8b 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -279,7 +279,9 @@ function scorm_get_tracks($scoid,$userid,$attempt='') { $usertrack->timemodified = $track->timemodified; } } - ksort($usertrack); + if (is_array($usertrack)) { + ksort($usertrack); + } return $usertrack; } else { return false; @@ -515,7 +517,7 @@ function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') { if (empty($organization)) { $organization = $scorm->launch; } - if ($orgs = $DB->get_records_select_menu('scorm_scoes', array('scorm'=>$scorm->id, 'organization'=>'', 'launch'=>''), 'id', 'id,title')) { + if ($orgs = $DB->get_records_menu('scorm_scoes', array('scorm'=>$scorm->id, 'organization'=>'', 'launch'=>''), 'id', 'id,title')) { if (count($orgs) > 1) { ?>