diff --git a/src/core/features/compile/components/compile-html/compile-html.ts b/src/core/features/compile/components/compile-html/compile-html.ts index e3c72975e..f548647b1 100644 --- a/src/core/features/compile/components/compile-html/compile-html.ts +++ b/src/core/features/compile/components/compile-html/compile-html.ts @@ -117,7 +117,7 @@ export class CoreCompileHtmlComponent implements OnChanges, OnDestroy, DoCheck { // eslint-disable-next-line @angular-eslint/no-conflicting-lifecycle async ngOnChanges(changes: Record): Promise { // Only compile if text/javascript has changed or the forceCompile flag has been set to true. - if (this.text && (changes.text || changes.javascript || + if (this.text !== undefined && (changes.text || changes.javascript || (changes.forceCompile && CoreUtils.isTrueOrOne(this.forceCompile)))) { // Create a new component and a new module. diff --git a/src/core/features/course/services/course-helper.ts b/src/core/features/course/services/course-helper.ts index b72b4a201..1f2976402 100644 --- a/src/core/features/course/services/course-helper.ts +++ b/src/core/features/course/services/course-helper.ts @@ -681,14 +681,14 @@ export class CoreCourseHelperProvider { throw new CoreError(Translate.instant('core.filenotfound')); } - if (!CoreFileHelper.isOpenableInApp(module.contents[0])) { + const mainFile = files[0]; + + if (!CoreFileHelper.isOpenableInApp(mainFile)) { await CoreFileHelper.showConfirmOpenUnsupportedFile(); } const site = await CoreSites.getSite(siteId); - const mainFile = files[0]; - // Check if the file should be opened in browser. if (CoreFileHelper.shouldOpenInBrowser(mainFile)) { return this.openModuleFileInBrowser(mainFile.fileurl, site, module, courseId, component, componentId, files); diff --git a/src/core/features/siteplugins/classes/handlers/main-menu-home-handler.ts b/src/core/features/siteplugins/classes/handlers/main-menu-home-handler.ts index 1e2904b9d..7c0a6b4a9 100644 --- a/src/core/features/siteplugins/classes/handlers/main-menu-home-handler.ts +++ b/src/core/features/siteplugins/classes/handlers/main-menu-home-handler.ts @@ -46,7 +46,7 @@ export class CoreSitePluginsMainMenuHomeHandler extends CoreSitePluginsBaseHandl return { title: this.title, class: this.handlerSchema.displaydata?.class, - page: `siteplugins/${this.plugin.component}/${this.handlerSchema.method}/0`, + page: `siteplugins/homecontent/${this.plugin.component}/${this.handlerSchema.method}`, pageParams: { title: this.title, initResult: this.initResult, diff --git a/src/core/features/siteplugins/siteplugins.module.ts b/src/core/features/siteplugins/siteplugins.module.ts index 7f15ec693..aaf1c573d 100644 --- a/src/core/features/siteplugins/siteplugins.module.ts +++ b/src/core/features/siteplugins/siteplugins.module.ts @@ -28,6 +28,13 @@ const routes: Routes = [ }, ]; +const homeRoutes: Routes = [ + { + path: 'siteplugins/homecontent/:component/:method', + loadChildren: () => import('./pages/plugin-page/plugin-page.module').then( m => m.CoreSitePluginsPluginPageModule), + }, +]; + const courseIndexRoutes: Routes = [ { path: 'siteplugins/:handlerUniqueName', @@ -47,7 +54,7 @@ const moduleRoutes: Routes = [ imports: [ CoreMainMenuTabRoutingModule.forChild(moduleRoutes.concat(routes)), CoreCourseIndexRoutingModule.forChild({ children: courseIndexRoutes }), - CoreMainMenuHomeRoutingModule.forChild({ children: routes }), + CoreMainMenuHomeRoutingModule.forChild({ children: homeRoutes }), CoreSitePluginsComponentsModule, ], providers: [