From cea8753ff28a3b6c695ffd10e183c9f4e6fb5e45 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 28 Mar 2019 12:10:59 +0100 Subject: [PATCH] Replace dynamic ViewBag with ViewData --- .../Umbraco/Install/Views/Index.cshtml | 6 +- .../Umbraco/Views/AuthorizeUpgrade.cshtml | 4 +- .../Umbraco/Views/Default.cshtml | 4 +- .../Editors/BackOfficeController.cs | 37 ++++------ .../Install/Controllers/InstallController.cs | 4 +- src/Umbraco.Web/Umbraco.Web.csproj | 1 + src/Umbraco.Web/ViewDataExtensions.cs | 71 +++++++++++++++++++ 7 files changed, 95 insertions(+), 32 deletions(-) create mode 100644 src/Umbraco.Web/ViewDataExtensions.cs diff --git a/src/Umbraco.Web.UI/Umbraco/Install/Views/Index.cshtml b/src/Umbraco.Web.UI/Umbraco/Install/Views/Index.cshtml index 1d397bfd01..e74dbea217 100644 --- a/src/Umbraco.Web.UI/Umbraco/Install/Views/Index.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/Install/Views/Index.cshtml @@ -7,7 +7,7 @@ - + @@ -66,8 +66,8 @@ var Umbraco = {}; Umbraco.Sys = {}; Umbraco.Sys.ServerVariables = { - "installApiBaseUrl": "@ViewBag.InstallApiBaseUrl", - "umbracoBaseUrl": "@ViewBag.UmbracoBaseFolder" + "installApiBaseUrl": "@ViewData.GetInstallApiBaseUrl()", + "umbracoBaseUrl": "@ViewData.GetUmbracoBaseFolder()" }; diff --git a/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml b/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml index fba9a83789..b7c1e6540c 100644 --- a/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml @@ -51,7 +51,7 @@ @{ var externalLoginUrl = Url.Action("ExternalLogin", "BackOffice", new { - area = ViewBag.UmbracoPath, + area = ViewData.GetUmbracoPath(), //Custom redirect URL since we don't want to just redirect to the back office since this is for authing upgrades redirectUrl = Url.Action("AuthorizeUpgrade", "BackOffice") }); @@ -61,7 +61,7 @@