From 995f3f38a33ba4dd0ab68cdc5152d0c2bb634a8f Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 21 Mar 2018 12:52:17 +1100 Subject: [PATCH] Fixes upgrade issue with copying the preview.old directory and updates the link to the the correct public one --- .../RenamePreviewFolder.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTenZero/RenamePreviewFolder.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTenZero/RenamePreviewFolder.cs index 248492a3ea..5545038ba0 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTenZero/RenamePreviewFolder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTenZero/RenamePreviewFolder.cs @@ -25,12 +25,15 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTenZero if (Directory.Exists(previewFolderPath)) { var newPath = previewFolderPath.Replace("preview", "preview.old"); - Directory.Move(previewFolderPath, newPath); - var readmeText = - $"Static html files used for preview and canvas editing functionality no longer live in this directory.\r\n" + - $"Instead they have been recreated as MVC views and can now be found in '~/Umbraco/Views/Preview'.\r\n" + - $"See issue: http://issues.umbraco.org/issue/UAASSCRUM-1405"; - File.WriteAllText(Path.Combine(newPath, "readme.txt"), readmeText); + if (Directory.Exists(newPath) == false) + { + Directory.Move(previewFolderPath, newPath); + var readmeText = + $"Static html files used for preview and canvas editing functionality no longer live in this directory.\r\n" + + $"Instead they have been recreated as MVC views and can now be found in '~/Umbraco/Views/Preview'.\r\n" + + $"See issue: http://issues.umbraco.org/issue/U4-11090"; + File.WriteAllText(Path.Combine(newPath, "readme.txt"), readmeText); + } } }