From ad97538d8aa71cbb66108a8cc086b0a8d831b25e Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 24 Nov 2009 21:03:46 +0000 Subject: [PATCH] SCORM MDL-20955 fix bad use of update_record - thanks Petr --- mod/scorm/datamodels/aicclib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/scorm/datamodels/aicclib.php b/mod/scorm/datamodels/aicclib.php index bfa56babf86..c5fab236e42 100644 --- a/mod/scorm/datamodels/aicclib.php +++ b/mod/scorm/datamodels/aicclib.php @@ -266,7 +266,9 @@ function scorm_parse_aicc($scorm) { $id = null; if ($oldscoid = scorm_array_search('identifier',$sco->identifier,$oldscoes)) { $sco->id = $oldscoid; - $id = $DB->update_record('scorm_scoes',$sco); + if ($DB->update_record('scorm_scoes',$sco)) { + $id = $oldscoid; + } $DB->delete_records('scorm_scoes_data', array('scoid'=>$oldscoid)); unset($oldscoes[$oldscoid]); } else {