From 41e419a49eb11e8087586147f8e031c0c202e8b7 Mon Sep 17 00:00:00 2001 From: Claus Date: Fri, 1 Sep 2017 13:48:39 +0200 Subject: [PATCH 1/4] =?UTF-8?q?U4-10370=20Culture=20and=20hostnames=20with?= =?UTF-8?q?=20"=C3=A6=C3=B8=C3=A5"=20after=20/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Umbraco.Web/Routing/DomainHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Routing/DomainHelper.cs b/src/Umbraco.Web/Routing/DomainHelper.cs index 6934b08cf2..0a6c8fb8c7 100644 --- a/src/Umbraco.Web/Routing/DomainHelper.cs +++ b/src/Umbraco.Web/Routing/DomainHelper.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Services; @@ -269,7 +270,7 @@ namespace Umbraco.Web.Routing /// Eg the relative part of /foo/bar/nil to domain example.com/foo is /bar/nil. public static string PathRelativeToDomain(Uri domainUri, string path) { - return path.Substring(domainUri.AbsolutePath.Length).EnsureStartsWith('/'); + return Uri.EscapeUriString(path).Substring(domainUri.AbsolutePath.Length).EnsureStartsWith('/'); } #endregion From 22cef52261e10ab6a6c204673b3eeb7844a50fda Mon Sep 17 00:00:00 2001 From: Claus Date: Fri, 1 Sep 2017 13:50:51 +0200 Subject: [PATCH 2/4] removing using. --- src/Umbraco.Web/Routing/DomainHelper.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Umbraco.Web/Routing/DomainHelper.cs b/src/Umbraco.Web/Routing/DomainHelper.cs index 0a6c8fb8c7..ab2c14f009 100644 --- a/src/Umbraco.Web/Routing/DomainHelper.cs +++ b/src/Umbraco.Web/Routing/DomainHelper.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Services; From 9a06c3a5ffe5e63853e3d4ee7d88c3871065e83c Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 4 Sep 2017 11:30:53 +0200 Subject: [PATCH 3/4] Implement ILocalizationService.GetDictionaryItemKeyMap --- .../Repositories/DictionaryRepository.cs | 13 ++++++++ .../Interfaces/IDictionaryRepository.cs | 1 + .../Services/ILocalizationService.cs | 6 ++++ .../Services/LocalizationService.cs | 9 ++++++ .../Repositories/DictionaryRepositoryTest.cs | 30 +++++++++++++++---- 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Repositories/DictionaryRepository.cs b/src/Umbraco.Core/Persistence/Repositories/DictionaryRepository.cs index 968c2d9cb0..7196165e6f 100644 --- a/src/Umbraco.Core/Persistence/Repositories/DictionaryRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/DictionaryRepository.cs @@ -260,6 +260,19 @@ namespace Umbraco.Core.Persistence.Repositories return GetByQuery(query); } + public Dictionary GetDictionaryItemKeyMap() + { + var columns = new[] { "key", "id" }.Select(x => (object) SqlSyntax.GetQuotedColumnName(x)).ToArray(); + var sql = new Sql().Select(columns).From(SqlSyntax); + return Database.Fetch(sql).ToDictionary(x => x.Key, x => x.Id); + } + + private class DictionaryItemKeyIdDto + { + public string Key { get; set; } + public Guid Id { get; set; } + } + public IEnumerable GetDictionaryItemDescendants(Guid? parentId) { //This methods will look up children at each level, since we do not store a path for dictionary (ATM), we need to do a recursive diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs index d030bcda2a..5c120c76cb 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs @@ -9,5 +9,6 @@ namespace Umbraco.Core.Persistence.Repositories IDictionaryItem Get(Guid uniqueId); IDictionaryItem Get(string key); IEnumerable GetDictionaryItemDescendants(Guid? parentId); + Dictionary GetDictionaryItemKeyMap(); } } \ No newline at end of file diff --git a/src/Umbraco.Core/Services/ILocalizationService.cs b/src/Umbraco.Core/Services/ILocalizationService.cs index e6563b7ee9..a49b8e203e 100644 --- a/src/Umbraco.Core/Services/ILocalizationService.cs +++ b/src/Umbraco.Core/Services/ILocalizationService.cs @@ -136,5 +136,11 @@ namespace Umbraco.Core.Services /// to delete /// Optional id of the user deleting the language void Delete(ILanguage language, int userId = 0); + + /// + /// Gets the full dictionary key map. + /// + /// The full dictionary key map. + Dictionary GetDictionaryItemKeyMap(); } } \ No newline at end of file diff --git a/src/Umbraco.Core/Services/LocalizationService.cs b/src/Umbraco.Core/Services/LocalizationService.cs index 12a2afb6ad..fa09d539ee 100644 --- a/src/Umbraco.Core/Services/LocalizationService.cs +++ b/src/Umbraco.Core/Services/LocalizationService.cs @@ -405,6 +405,15 @@ namespace Umbraco.Core.Services } } + public Dictionary GetDictionaryItemKeyMap() + { + using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) + { + var repository = RepositoryFactory.CreateDictionaryRepository(uow); + return repository.GetDictionaryItemKeyMap(); + } + } + #region Event Handlers /// /// Occurs before Delete diff --git a/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs index 3a85978f40..5527817caa 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using Moq; using NUnit.Framework; @@ -122,7 +123,7 @@ namespace Umbraco.Tests.Persistence.Repositories //re-get dictionaryItem = repository.Get(dictionaryItem.Id); - + // Assert Assert.That(dictionaryItem, Is.Not.Null); @@ -140,10 +141,10 @@ namespace Umbraco.Tests.Persistence.Repositories // Arrange var provider = new PetaPocoUnitOfWorkProvider(Logger); var unitOfWork = provider.GetUnitOfWork(); - + using (var repository = CreateRepository(unitOfWork)) { - var dictionaryItem = (IDictionaryItem) new DictionaryItem("Testing1235"); + var dictionaryItem = (IDictionaryItem) new DictionaryItem("Testing1235"); repository.AddOrUpdate(dictionaryItem); unitOfWork.Commit(); @@ -160,7 +161,6 @@ namespace Umbraco.Tests.Persistence.Repositories } - [Test] public void Can_Perform_GetAll_On_DictionaryRepository() { @@ -319,7 +319,7 @@ namespace Umbraco.Tests.Persistence.Repositories unitOfWork.Commit(); var dictionaryItem = (DictionaryItem)repository.Get(1); - + // Assert Assert.That(dictionaryItem, Is.Not.Null); Assert.That(dictionaryItem.Translations.Count(), Is.EqualTo(3)); @@ -364,6 +364,24 @@ namespace Umbraco.Tests.Persistence.Repositories } } + [Test] + public void Can_Perform_GetDictionaryItemKeyMap_On_DictionaryRepository() + { + Dictionary keyMap; + + var provider = new PetaPocoUnitOfWorkProvider(Logger); + using (var unitOfWork = provider.GetUnitOfWork(readOnly: true)) + { + var repository = CreateRepository(unitOfWork); + keyMap = repository.GetDictionaryItemKeyMap(); + } + + Assert.IsNotNull(keyMap); + Assert.IsNotEmpty(keyMap); + foreach (var kvp in keyMap) + Console.WriteLine("{0}: {1}", kvp.Key, kvp.Value); + } + [TearDown] public override void TearDown() { From 895faf41b1187c823f80081461b50b47c926f722 Mon Sep 17 00:00:00 2001 From: mikkelhm Date: Mon, 4 Sep 2017 12:28:16 +0200 Subject: [PATCH 4/4] Update version to 7.6.7 --- build/UmbracoVersion.txt | 2 +- src/SolutionInfo.cs | 4 ++-- src/Umbraco.Core/Configuration/UmbracoVersion.cs | 2 +- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/UmbracoVersion.txt b/build/UmbracoVersion.txt index c9c45982be..dfbf91c009 100644 --- a/build/UmbracoVersion.txt +++ b/build/UmbracoVersion.txt @@ -1,2 +1,2 @@ # Usage: on line 2 put the release version, on line 3 put the version comment (example: beta) -7.6.6 \ No newline at end of file +7.6.7 \ No newline at end of file diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 8563cc6b75..bf5ba3392f 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -11,5 +11,5 @@ using System.Resources; [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyFileVersion("7.6.6")] -[assembly: AssemblyInformationalVersion("7.6.6")] \ No newline at end of file +[assembly: AssemblyFileVersion("7.6.7")] +[assembly: AssemblyInformationalVersion("7.6.7")] \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index 90de48ca2e..19b1c2c405 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration { public class UmbracoVersion { - private static readonly Version Version = new Version("7.6.6"); + private static readonly Version Version = new Version("7.6.7"); /// /// Gets the current version of Umbraco. diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index a94ac9da58..86bca220a6 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -2379,9 +2379,9 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\" True True - 7660 + 7670 / - http://localhost:7660 + http://localhost:7670 False False