NOMDL backup: missing AS for column alias
authorDavid Mudrak <david.mudrak@gmail.com>
Wed, 22 Sep 2010 13:37:24 +0000 (13:37 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Wed, 22 Sep 2010 13:37:24 +0000 (13:37 +0000)
Throws DML read exception in PostgreSQL. Credit goes to skodak.

backup/moodle2/backup_stepslib.php

index c8536dc..cf61e1e 100644 (file)
@@ -1788,7 +1788,7 @@ class backup_course_completion_structure_step extends backup_structure_step {
         $cc->add_child($aggregatemethod);
 
         // We need to get the courseinstances shortname rather than an ID for restore
         $cc->add_child($aggregatemethod);
 
         // We need to get the courseinstances shortname rather than an ID for restore
-        $criteria->set_source_sql("SELECT ccc.*, c.shortname courseinstanceshortname
+        $criteria->set_source_sql("SELECT ccc.*, c.shortname AS courseinstanceshortname
                                    FROM {course_completion_criteria} ccc
                                    LEFT JOIN {course} c ON c.id = ccc.courseinstance
                                    WHERE ccc.course = ?", array(backup::VAR_COURSEID));
                                    FROM {course_completion_criteria} ccc
                                    LEFT JOIN {course} c ON c.id = ccc.courseinstance
                                    WHERE ccc.course = ?", array(backup::VAR_COURSEID));