diff --git a/src/core/features/siteplugins/classes/handlers/module-handler.ts b/src/core/features/siteplugins/classes/handlers/module-handler.ts index e501e91c6..57b415309 100644 --- a/src/core/features/siteplugins/classes/handlers/module-handler.ts +++ b/src/core/features/siteplugins/classes/handlers/module-handler.ts @@ -63,18 +63,18 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp /** * @inheritdoc */ - getData( + async getData( module: CoreCourseModuleData, courseId: number, sectionId?: number, forCoursePage?: boolean, - ): CoreCourseModuleHandlerData { + ): Promise { if (this.shouldOnlyDisplayDescription(module, forCoursePage)) { const title = module.description; module.description = ''; return { - icon: this.getIconSrc(), + icon: await CoreCourse.getModuleIconSrc(module.modname, this.handlerSchema.displaydata?.icon), title: title || '', a11yTitle: '', class: this.handlerSchema.displaydata?.class, @@ -85,7 +85,7 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp const showDowloadButton = this.handlerSchema.downloadbutton; const handlerData: CoreCourseModuleHandlerData = { title: module.name, - icon: this.getIconSrc(), + icon: await CoreCourse.getModuleIconSrc(module.modname, this.handlerSchema.displaydata?.icon), class: this.handlerSchema.displaydata?.class, showDownloadButton: showDowloadButton !== undefined ? showDowloadButton : hasOffline, }; @@ -198,13 +198,6 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp } } - /** - * @inheritdoc - */ - getIconSrc(): string | undefined { - return this.handlerSchema.displaydata?.icon; - } - /** * @inheritdoc */