mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 20:50:21 +01:00
MDL-38147 do not use DB->sql_length because it does not work on MSSQL
This commit is contained in:
parent
4e53188a4b
commit
a32f163dfd
@ -737,7 +737,7 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
|
||||
$fields[] = 'c.summary';
|
||||
$fields[] = 'c.summaryformat';
|
||||
} else {
|
||||
$fields[] = $DB->sql_length('c.summary'). ' hassummary';
|
||||
$fields[] = $DB->sql_substr('c.summary', 1, 1). ' hassummary';
|
||||
}
|
||||
$sql = "SELECT ". join(',', $fields). ", $ctxselect
|
||||
FROM {course} c
|
||||
@ -749,6 +749,9 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
|
||||
if ($checkvisibility) {
|
||||
// Loop through all records and make sure we only return the courses accessible by user.
|
||||
foreach ($list as $course) {
|
||||
if (isset($list[$course->id]->hassummary)) {
|
||||
$list[$course->id]->hassummary = strlen($list[$course->id]->hassummary) > 0;
|
||||
}
|
||||
if (empty($course->visible)) {
|
||||
// load context only if we need to check capability
|
||||
context_helper::preload_from_record($course);
|
||||
|
Loading…
x
Reference in New Issue
Block a user