From 9bb6d8b20b41c8d02678c6a320f15b1262393c0e Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 30 Aug 2021 13:50:48 +0200 Subject: [PATCH 1/6] https://github.com/umbraco/Umbraco-CMS/issues/10927 - Fixed issue with translations but still support the fix for https://github.com/umbraco/Umbraco-CMS/issues/10627 --- src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs b/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs index 49512ccae8..39704b2bb2 100644 --- a/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs +++ b/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs @@ -65,7 +65,7 @@ namespace Umbraco.Extensions if (text == null) return null; - if (text.StartsWith("#") == false || text.IndexOf('_') == -1) + if (text.StartsWith("#") == false) return text; text = text.Substring(1); @@ -75,6 +75,9 @@ namespace Umbraco.Extensions return value; } + if (text.IndexOf('_') == -1) + return text; + var areaAndKey = text.Split('_'); if (areaAndKey.Length < 2) From 5953c9ebe7b89800d159b33cafa9865a324d313b Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 1 Sep 2021 07:50:17 +0200 Subject: [PATCH 2/6] Fixed issues with confusion about when to use umbracoPath and when to use the const. Now it is possible to change the location of backoffice. { "Umbraco": { "CMS": { "Global": { "UmbracoPath": "~/my-secret-loginpanel", "IconsPath": "~/my-secret-loginpanel/assets/icons" } } } } --- .../DependencyInjection/UmbracoBuilder.Services.cs | 2 +- .../Controllers/BackOfficeController.cs | 4 ++-- src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs index e535b399e4..861a05b459 100644 --- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs +++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs @@ -103,7 +103,7 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection { var hostingEnvironment = container.GetRequiredService(); var globalSettings = container.GetRequiredService>().Value; - var mainLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(globalSettings.UmbracoPath, "config", "lang"))); + var mainLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(Constants.SystemDirectories.Umbraco, "config", "lang"))); var appPlugins = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.AppPlugins)); var configLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(Constants.SystemDirectories.Config, "lang"))); diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs index a52e018f58..06ba156efc 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -118,7 +118,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers // force authentication to occur since this is not an authorized endpoint var result = await this.AuthenticateBackOfficeAsync(); - var viewPath = Path.Combine(_globalSettings.UmbracoPath , Constants.Web.Mvc.BackOfficeArea, nameof(Default) + ".cshtml") + var viewPath = Path.Combine(Constants.SystemDirectories.Umbraco, Constants.Web.Mvc.BackOfficeArea, nameof(Default) + ".cshtml") .Replace("\\", "/"); // convert to forward slashes since it's a virtual path return await RenderDefaultOrProcessExternalLoginAsync( @@ -204,7 +204,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers // force authentication to occur since this is not an authorized endpoint var result = await this.AuthenticateBackOfficeAsync(); - var viewPath = Path.Combine(_globalSettings.UmbracoPath, Constants.Web.Mvc.BackOfficeArea, nameof(AuthorizeUpgrade) + ".cshtml"); + var viewPath = Path.Combine(Constants.SystemDirectories.Umbraco, Constants.Web.Mvc.BackOfficeArea, nameof(AuthorizeUpgrade) + ".cshtml"); return await RenderDefaultOrProcessExternalLoginAsync( result, diff --git a/src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml b/src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml index 12a3c420fb..50394bc2a1 100644 --- a/src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml +++ b/src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml @@ -1,9 +1,11 @@ @using Microsoft.Extensions.Options; @using System.Globalization +@using Umbraco.Cms.Core @using Umbraco.Cms.Core.Configuration @using Umbraco.Cms.Core.Configuration.Models @using Umbraco.Cms.Core.Hosting @using Umbraco.Cms.Core.Logging +@using Umbraco.Cms.Core.Routing @using Umbraco.Cms.Core.Services @using Umbraco.Cms.Core.WebAssets @using Umbraco.Cms.Infrastructure.WebAssets @@ -119,7 +121,7 @@ } - + @if (isDebug) From 2876d0b179feab0bf12f6a68b9b9f0496b1c73ed Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 1 Sep 2021 10:57:21 +0200 Subject: [PATCH 3/6] Handle the msbuild copy in two steps, so we can override the wwwroot/umbraco folder from outside, using the following in the project csproj. my-secret-loginpanel it will now copy to wwwroot/my-secret-loginpanel instead of wwwroot/umbraco --- .../NuSpecs/build/Umbraco.Cms.StaticAssets.targets | 14 +++++++++++--- .../Install/InstallController.cs | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build/NuSpecs/build/Umbraco.Cms.StaticAssets.targets b/build/NuSpecs/build/Umbraco.Cms.StaticAssets.targets index 37b65e320c..0d712e083b 100644 --- a/build/NuSpecs/build/Umbraco.Cms.StaticAssets.targets +++ b/build/NuSpecs/build/Umbraco.Cms.StaticAssets.targets @@ -1,18 +1,26 @@  - $(MSBuildThisFileDirectory)..\content\**\*.* + $(MSBuildThisFileDirectory)..\content\umbraco\**\*.* + $(MSBuildThisFileDirectory)..\content\wwwroot\umbraco\**\*.* + umbraco + + + @@ -24,7 +32,7 @@ - + diff --git a/src/Umbraco.Web.BackOffice/Install/InstallController.cs b/src/Umbraco.Web.BackOffice/Install/InstallController.cs index 6e5b3314db..ca29a508c4 100644 --- a/src/Umbraco.Web.BackOffice/Install/InstallController.cs +++ b/src/Umbraco.Web.BackOffice/Install/InstallController.cs @@ -93,7 +93,7 @@ namespace Umbraco.Cms.Web.BackOffice.Install await _installHelper.SetInstallStatusAsync(false, ""); - return View(Path.Combine(baseFolder , Cms.Core.Constants.Web.Mvc.InstallArea, nameof(Index) + ".cshtml")); + return View(Path.Combine(Constants.SystemDirectories.Umbraco.TrimStart("~") , Cms.Core.Constants.Web.Mvc.InstallArea, nameof(Index) + ".cshtml")); } /// From eca26cd827d1569ee87781ca5c25b2e39066eab9 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 1 Sep 2021 10:57:33 +0200 Subject: [PATCH 4/6] Bump version to next rc --- build/templates/UmbracoPackage/.template.config/template.json | 2 +- build/templates/UmbracoProject/.template.config/template.json | 2 +- src/Directory.Build.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/templates/UmbracoPackage/.template.config/template.json b/build/templates/UmbracoPackage/.template.config/template.json index ef32835152..83d36238e2 100644 --- a/build/templates/UmbracoPackage/.template.config/template.json +++ b/build/templates/UmbracoPackage/.template.config/template.json @@ -24,7 +24,7 @@ "version": { "type": "parameter", "datatype": "string", - "defaultValue": "9.0.0-rc002", + "defaultValue": "9.0.0-rc003", "description": "The version of Umbraco to load using NuGet", "replaces": "UMBRACO_VERSION_FROM_TEMPLATE" }, diff --git a/build/templates/UmbracoProject/.template.config/template.json b/build/templates/UmbracoProject/.template.config/template.json index 9fa69b6df4..8414c5eeb3 100644 --- a/build/templates/UmbracoProject/.template.config/template.json +++ b/build/templates/UmbracoProject/.template.config/template.json @@ -57,7 +57,7 @@ "version": { "type": "parameter", "datatype": "string", - "defaultValue": "9.0.0-rc002", + "defaultValue": "9.0.0-rc003", "description": "The version of Umbraco to load using NuGet", "replaces": "UMBRACO_VERSION_FROM_TEMPLATE" }, diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 6fdc91dbde..6f5eb39964 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ 9.0.0 9.0.0 - 9.0.0-rc002 + 9.0.0-rc003 9.0.0 9.0 en-US From 375698594e10b161d296ae49ac36d60d71e9b9ff Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 1 Sep 2021 13:44:14 +0200 Subject: [PATCH 5/6] Fixed NoNodes.cshtml when moved the wwwroot/umbraco folder --- .../umbraco/UmbracoWebsite/NoNodes.cshtml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/UmbracoWebsite/NoNodes.cshtml b/src/Umbraco.Web.UI/umbraco/UmbracoWebsite/NoNodes.cshtml index 694d66c056..a19390f8ec 100644 --- a/src/Umbraco.Web.UI/umbraco/UmbracoWebsite/NoNodes.cshtml +++ b/src/Umbraco.Web.UI/umbraco/UmbracoWebsite/NoNodes.cshtml @@ -1,4 +1,14 @@ -@model Umbraco.Cms.Web.Website.Models.NoNodesViewModel +@using Microsoft.Extensions.Options +@using Umbraco.Cms.Core.Configuration.Models +@using Umbraco.Cms.Core.Hosting +@using Umbraco.Cms.Core.Routing +@using Umbraco.Extensions +@model Umbraco.Cms.Web.Website.Models.NoNodesViewModel +@inject IHostingEnvironment hostingEnvironment +@inject IOptions globalSettings +@{ + var backOfficePath = globalSettings.Value.GetBackOfficePath(hostingEnvironment); +} @@ -8,7 +18,7 @@ Umbraco: No Published Content - + From e284e30df538f952c6044bff9594dfc444530463 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 8 Sep 2021 18:29:24 +0200 Subject: [PATCH 6/6] Fixed issues where we used the global setting UmbracoPath instead of the constant --- src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs | 2 +- src/Umbraco.Infrastructure/Services/Implement/FileService.cs | 4 ++-- src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs b/src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs index 7c28e09445..0ad2271d7e 100644 --- a/src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs +++ b/src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs @@ -50,7 +50,7 @@ namespace Umbraco.Cms.Infrastructure.Install _packagesPermissionsDirs = new[] { hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.Bin), - hostingEnvironment.MapPathContentRoot(_globalSettings.UmbracoPath), + hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.Umbraco), hostingEnvironment.MapPathWebRoot(_globalSettings.UmbracoPath), hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.Packages) }; diff --git a/src/Umbraco.Infrastructure/Services/Implement/FileService.cs b/src/Umbraco.Infrastructure/Services/Implement/FileService.cs index ed7bdc9c29..017312e306 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/FileService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/FileService.cs @@ -624,7 +624,7 @@ namespace Umbraco.Cms.Core.Services.Implement public IEnumerable GetPartialViewSnippetNames(params string[] filterNames) { - var snippetPath = _hostingEnvironment.MapPathContentRoot($"{_globalSettings.UmbracoPath}/PartialViewMacros/Templates/"); + var snippetPath = _hostingEnvironment.MapPathContentRoot($"{Constants.SystemDirectories.Umbraco}/PartialViewMacros/Templates/"); var files = Directory.GetFiles(snippetPath, "*.cshtml") .Select(Path.GetFileNameWithoutExtension) .Except(filterNames, StringComparer.InvariantCultureIgnoreCase) @@ -835,7 +835,7 @@ namespace Umbraco.Cms.Core.Services.Implement fileName += ".cshtml"; } - var snippetPath = _hostingEnvironment.MapPathContentRoot($"{_globalSettings.UmbracoPath}/PartialViewMacros/Templates/{fileName}"); + var snippetPath = _hostingEnvironment.MapPathContentRoot($"{Constants.SystemDirectories.Umbraco}/PartialViewMacros/Templates/{fileName}"); return System.IO.File.Exists(snippetPath) ? Attempt.Succeed(snippetPath) : Attempt.Fail(); diff --git a/src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs b/src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs index 51e9dae975..44e08f0af1 100644 --- a/src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs +++ b/src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs @@ -347,7 +347,7 @@ namespace Umbraco.Cms.Web.Common.ModelsBuilder } - public string PureLiveDirectoryAbsolute() => _hostingEnvironment.MapPathContentRoot("~/umbraco/Data/TEMP/PureLive"); + public string PureLiveDirectoryAbsolute() => _hostingEnvironment.MapPathContentRoot(Core.Constants.SystemDirectories.TempData+"/InMemoryAuto"); // This is NOT thread safe but it is only called from within a lock