MDL-40120: Fix get_course_records() which breaks in PSQL
authorTim Lock <tim.lock@netspot.com.au>
Mon, 10 Jun 2013 23:24:01 +0000 (08:54 +0930)
committerSam Hemelryk <sam@moodle.com>
Tue, 11 Jun 2013 01:45:23 +0000 (13:45 +1200)
lib/coursecatlib.php

index 6cf2ea1..2a5e06d 100644 (file)
@@ -833,7 +833,7 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
             $fields[] = 'c.summary';
             $fields[] = 'c.summaryformat';
         } else {
-            $fields[] = $DB->sql_substr('c.summary', 1, 1). ' hassummary';
+            $fields[] = $DB->sql_substr('c.summary', 1, 1). ' as hassummary';
         }
         $sql = "SELECT ". join(',', $fields). ", $ctxselect
                 FROM {course} c