diff --git a/src/core/course/formats/singleactivity/providers/handler.ts b/src/core/course/formats/singleactivity/providers/handler.ts index 8a4a3d776..328ae5ee6 100644 --- a/src/core/course/formats/singleactivity/providers/handler.ts +++ b/src/core/course/formats/singleactivity/providers/handler.ts @@ -49,7 +49,7 @@ export class CoreCourseFormatSingleActivityHandler implements CoreCourseFormatHa } /** - * Get the title to use in course page. If not defined, course fullname. + * Get the title to use in course page. If not defined, course displayname or fullname. * This function will be called without sections first, and then call it again when the sections are retrieved. * * @param {any} course The course. @@ -61,7 +61,13 @@ export class CoreCourseFormatSingleActivityHandler implements CoreCourseFormatHa return sections[0].modules[0].name; } - return course.fullname || ''; + if (course.displayname) { + return course.displayname; + } else if (course.fullname) { + return course.fullname; + } else { + return ''; + } } /** diff --git a/src/core/course/providers/default-format.ts b/src/core/course/providers/default-format.ts index 45bcfe551..921a91c00 100644 --- a/src/core/course/providers/default-format.ts +++ b/src/core/course/providers/default-format.ts @@ -44,7 +44,13 @@ export class CoreCourseFormatDefaultHandler implements CoreCourseFormatHandler { * @return {string} Title. */ getCourseTitle(course: any): string { - return course.fullname || ''; + if (course.displayname) { + return course.displayname; + } else if (course.fullname) { + return course.fullname; + } else { + return ''; + } } /**