diff --git a/src/core/course/pages/section/section.ts b/src/core/course/pages/section/section.ts index 492266caf..9c3bb2e47 100644 --- a/src/core/course/pages/section/section.ts +++ b/src/core/course/pages/section/section.ts @@ -209,7 +209,7 @@ export class CoreCourseSectionPage implements OnDestroy { // Get the overview files. if (this.course.overviewfiles) { this.course.imageThumb = this.course.overviewfiles[0] && this.course.overviewfiles[0].fileurl; - } else { + } else if (this.coursesProvider.isGetCoursesByFieldAvailable()) { promises.push(this.coursesProvider.getCoursesByField('id', this.course.id).then((coursesInfo) => { if (coursesInfo[0] && coursesInfo[0].overviewfiles && coursesInfo[0].overviewfiles[0]) { this.course.imageThumb = coursesInfo[0].overviewfiles[0].fileurl; diff --git a/src/core/course/providers/default-format.ts b/src/core/course/providers/default-format.ts index 10919e155..f83dd2057 100644 --- a/src/core/course/providers/default-format.ts +++ b/src/core/course/providers/default-format.ts @@ -97,6 +97,15 @@ export class CoreCourseFormatDefaultHandler implements CoreCourseFormatHandler { * @return {any|Promise} Current section (or promise resolved with current section). */ getCurrentSection(course: any, sections: any[]): any | Promise { + if (!this.coursesProvider.isGetCoursesByFieldAvailable()) { + // Cannot get the current section, return the first one. + if (sections[0].id != CoreCourseProvider.ALL_SECTIONS_ID) { + return sections[0]; + } + + return sections[1]; + } + // We need the "marker" to determine the current section. return this.coursesProvider.getCoursesByField('id', course.id).catch(() => { // Ignore errors. diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts index 9956ac920..46f026e67 100644 --- a/src/core/course/providers/helper.ts +++ b/src/core/course/providers/helper.ts @@ -1007,7 +1007,9 @@ export class CoreCourseHelperProvider { }); // Prefetch other data needed to render the course. - promises.push(this.coursesProvider.getCoursesByField('id', course.id)); + if (this.coursesProvider.isGetCoursesByFieldAvailable()) { + promises.push(this.coursesProvider.getCoursesByField('id', course.id)); + } promises.push(this.courseProvider.getActivitiesCompletionStatus(course.id)); return this.utils.allPromises(promises); diff --git a/src/core/courses/pages/my-courses/my-courses.ts b/src/core/courses/pages/my-courses/my-courses.ts index 47c28dec8..f264cdbdb 100644 --- a/src/core/courses/pages/my-courses/my-courses.ts +++ b/src/core/courses/pages/my-courses/my-courses.ts @@ -96,7 +96,7 @@ export class CoreCoursesMyCoursesPage implements OnDestroy { this.courseIds = courseIds.join(','); - if (this.courseIds) { + if (this.courseIds && this.coursesProvider.isGetCoursesByFieldAvailable()) { // Load course image of all the courses. promises.push(this.coursesProvider.getCoursesByField('ids', this.courseIds).then((coursesInfo) => { coursesInfo = this.utils.arrayToObject(coursesInfo, 'id'); diff --git a/src/core/courses/pages/my-overview/my-overview.ts b/src/core/courses/pages/my-overview/my-overview.ts index a698ff34b..da02b2b5d 100644 --- a/src/core/courses/pages/my-overview/my-overview.ts +++ b/src/core/courses/pages/my-overview/my-overview.ts @@ -233,7 +233,7 @@ export class CoreCoursesMyOverviewPage implements OnDestroy { this.courseIds = courseIds.join(','); - if (this.courseIds) { + if (this.courseIds && this.coursesProvider.isGetCoursesByFieldAvailable()) { // Load course image of all the courses. promises.push(this.coursesProvider.getCoursesByField('ids', this.courseIds).then((coursesInfo) => { coursesInfo = this.utils.arrayToObject(coursesInfo, 'id');