From 70dc482e9ad4bf2a8cf11fdaf6373553af7eb3ba Mon Sep 17 00:00:00 2001 From: Magnus Pettersson Date: Sat, 20 Jan 2024 23:00:08 +0100 Subject: [PATCH 1/3] Admin Template view not found. --- .../OrchardCore.Templates/Controllers/TemplateController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs b/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs index 4ba0505ef3d..b7a151b41a9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs @@ -115,7 +115,7 @@ public async Task Index(ContentOptions options, PagerParameters p new SelectListItem(S["Delete"], nameof(ContentsBulkAction.Remove)), ]; - return View(model); + return View("Index", model); } [HttpPost, ActionName(nameof(Index))] From 3fe237cd012f6047839bdfd1de1131afa61d662f Mon Sep 17 00:00:00 2001 From: Magnus Pettersson Date: Sun, 21 Jan 2024 13:43:50 +0100 Subject: [PATCH 2/3] Remove hard coded view name. --- .../OrchardCore.Templates/Controllers/TemplateController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs b/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs index b7a151b41a9..620bcc4e55e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs @@ -115,7 +115,8 @@ public async Task Index(ContentOptions options, PagerParameters p new SelectListItem(S["Delete"], nameof(ContentsBulkAction.Remove)), ]; - return View("Index", model); + // Both the Templates and Admin Templates use the same view (Index.cshtml) but with a different route. + return View(nameof(Index), model); } [HttpPost, ActionName(nameof(Index))] From a61a1e81b1a0ce3615297ab6ac66dee8c478e2bb Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Sun, 21 Jan 2024 14:59:15 -0800 Subject: [PATCH 3/3] Update TemplateController.cs --- .../OrchardCore.Templates/Controllers/TemplateController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs b/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs index 620bcc4e55e..655f0bba613 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Templates/Controllers/TemplateController.cs @@ -115,7 +115,8 @@ public async Task Index(ContentOptions options, PagerParameters p new SelectListItem(S["Delete"], nameof(ContentsBulkAction.Remove)), ]; - // Both the Templates and Admin Templates use the same view (Index.cshtml) but with a different route. + // The 'Admin' action redirect the user to the 'Index' action. + // To ensure we render the same 'Index' view in both cases, we have to explicitly specify the name of the view that should be rendered. return View(nameof(Index), model); }