diff --git a/src/classes/site.ts b/src/classes/site.ts index 04d133a2c..2a0bf52a3 100644 --- a/src/classes/site.ts +++ b/src/classes/site.ts @@ -176,7 +176,8 @@ export class CoreSite { 3.3: 2017051503, 3.4: 2017111300, 3.5: 2018051700, - 3.6: 2018120300 + 3.6: 2018120300, + 3.7: 2019030700 // @todo: Replace it with the right 3.7 date when released }; // Rest of variables. diff --git a/src/core/courses/providers/courses.ts b/src/core/courses/providers/courses.ts index d4e492aa8..42e3ff7c5 100644 --- a/src/core/courses/providers/courses.ts +++ b/src/core/courses/providers/courses.ts @@ -682,14 +682,19 @@ export class CoreCoursesProvider { return this.sitesProvider.getSite(siteId).then((site) => { const userId = site.getUserId(), - data = { + data: any = { userid: userId }, preSets = { cacheKey: this.getUserCoursesCacheKey(), + getCacheUsingCacheKey: true, omitExpires: !!preferCache }; + if (site.isVersionGreaterEqualThan('3.7')) { + data.returnusercount = 0; + } + return site.read('core_enrol_get_users_courses', data, preSets); }); }