From d89205abaf43631b08970d1e131fdaa045222733 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 12 Mar 2014 15:08:55 +1100 Subject: [PATCH] Fixes: U4-4395 YSOD when creating membergroup --- .../Persistence/Repositories/MemberGroupRepository.cs | 5 +++-- src/Umbraco.Web/Install/InstallHelper.cs | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs index 1d5fca9770..8e051e77e5 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs @@ -121,10 +121,11 @@ namespace Umbraco.Core.Persistence.Repositories var dto = _modelFactory.BuildDto(group); var o = Database.IsNew(dto) ? Convert.ToInt32(Database.Insert(dto)) : Database.Update(dto); - //Update with new correct path + //Update with new correct path and id dto.Path = string.Concat("-1,", dto.NodeId); Database.Update(dto); - + //assign to entity + group.Id = o; group.ResetDirtyProperties(); } diff --git a/src/Umbraco.Web/Install/InstallHelper.cs b/src/Umbraco.Web/Install/InstallHelper.cs index ff57de7454..3208a91a9f 100644 --- a/src/Umbraco.Web/Install/InstallHelper.cs +++ b/src/Umbraco.Web/Install/InstallHelper.cs @@ -72,7 +72,10 @@ namespace Umbraco.Web.Install Directory.Move(IOHelper.MapPath(SystemDirectories.Install), IOHelper.MapPath("~/app_data/temp/install_backup")); if (Directory.Exists(IOHelper.MapPath("~/Areas/UmbracoInstall"))) - Directory.Delete(IOHelper.MapPath("~/Areas/UmbracoInstall")); + { + Directory.Delete(IOHelper.MapPath("~/Areas/UmbracoInstall"), true); + } + } ///