Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SCORM MDL-21568 fix regression merged from head

  • Loading branch information...
commit c35d76a0669920cecd6dc4362b8c7fee683a2c5a 1 parent e13b7dc
@danmarsden danmarsden authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 mod/scorm/db/upgrade.php
View
16 mod/scorm/db/upgrade.php
@@ -302,9 +302,11 @@ function xmldb_scorm_upgrade($oldversion=0) {
$result = $result && add_field($table, $field);
/// fix bad usage of whatgrade/grading method.
$scorms = get_records('scorm');
- foreach ($scorms as $scorm) {
- $scorm->whatgrade = $scorm->grademethod/10;
- update_record('scorm', $scorm);
+ if (!empty($scorm)) {
+ foreach ($scorms as $scorm) {
+ $scorm->whatgrade = $scorm->grademethod/10;
+ update_record('scorm', $scorm);
+ }
}
set_config('whatgradefixed', '1', 'scorm'); //set this so that when upgrade to Moodle 2.0 we don't do this again.
}
@@ -312,9 +314,11 @@ function xmldb_scorm_upgrade($oldversion=0) {
if ($result && $oldversion < 2007110503) {
/// fix bad usage of whatgrade/grading method
$scorms = get_records('scorm');
- foreach ($scorms as $scorm) {
- $scorm->grademethod = $scorm->grademethod%10;
- update_record('scorm', $scorm);
+ if (!empty($scorm)) {
+ foreach ($scorms as $scorm) {
+ $scorm->grademethod = $scorm->grademethod%10;
+ update_record('scorm', $scorm);
+ }
}
set_config('grademethodfixed', '1', 'scorm'); //set this so that when upgrade to Moodle 2.0 we don't do this again.
}
Please sign in to comment.
Something went wrong with that request. Please try again.