From 2c885f7a86df0248d4633d1be42654017ec346f3 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 12 Aug 2021 14:30:10 +0200 Subject: [PATCH 01/13] Bump version to 8.14.3 --- src/SolutionInfo.cs | 4 ++-- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 625cbe3fb7..b9bbd54c8e 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -18,5 +18,5 @@ using System.Resources; [assembly: AssemblyVersion("8.0.0")] // these are FYI and changed automatically -[assembly: AssemblyFileVersion("8.14.2")] -[assembly: AssemblyInformationalVersion("8.14.2")] +[assembly: AssemblyFileVersion("8.14.3")] +[assembly: AssemblyInformationalVersion("8.14.3")] diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index ce465c6dc5..95ba9de0ca 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -348,9 +348,9 @@ False True - 8142 + 8143 / - http://localhost:8142 + http://localhost:8143 8131 / http://localhost:8131 From a5ff1830153b22012bbbdf0b8f942d45050d5cb0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 12 Aug 2021 14:48:15 +0200 Subject: [PATCH 02/13] Bump version to 8.15.2 --- src/SolutionInfo.cs | 4 ++-- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 2dac2d8791..ff286570c3 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -18,5 +18,5 @@ using System.Resources; [assembly: AssemblyVersion("8.0.0")] // these are FYI and changed automatically -[assembly: AssemblyFileVersion("8.15.1")] -[assembly: AssemblyInformationalVersion("8.15.1")] +[assembly: AssemblyFileVersion("8.15.2")] +[assembly: AssemblyInformationalVersion("8.15.2")] diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index ea238d42d1..56ed9483fe 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -348,9 +348,9 @@ False True - 8151 + 8152 / - http://localhost:8151 + http://localhost:8152 False False From 33feb808dd934cd4b1160ea9bd66b7783507d05f Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 12 Aug 2021 14:56:55 +0200 Subject: [PATCH 03/13] Fix version dependencies --- build/NuSpecs/UmbracoCms.nuspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index a223704617..db34b5e984 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -26,8 +26,8 @@ not want this to happen as the alpha of the next major is, really, the next major already. --> - - + + From d566d42c4b5470607635c985411ae6c0bbcdfe70 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 20 Aug 2021 14:20:46 +0200 Subject: [PATCH 04/13] Remove unintentional change from 15 months ago that causes you to end up in your windows users folder after each build --- build/build.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/build.ps1 b/build/build.ps1 index 15d455b976..9ff7a097fd 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -553,7 +553,6 @@ # run if (-not $get) { -cd if ($command.Length -eq 0) { $command = @( "Build" ) From 3030269bdef03af05028e709ab920df1b343ce89 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 20 Aug 2021 14:21:22 +0200 Subject: [PATCH 05/13] Create a cloud-specific zip that includes necessary config transforms for cloud --- build/NuSpecs/tools/Web.config.cloud.xdt | 29 ++++++++++++++++++++++++ build/build.ps1 | 9 ++++++++ 2 files changed, 38 insertions(+) create mode 100644 build/NuSpecs/tools/Web.config.cloud.xdt diff --git a/build/NuSpecs/tools/Web.config.cloud.xdt b/build/NuSpecs/tools/Web.config.cloud.xdt new file mode 100644 index 0000000000..988c741126 --- /dev/null +++ b/build/NuSpecs/tools/Web.config.cloud.xdt @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build.ps1 b/build/build.ps1 index 9ff7a097fd..55ceb774ee 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -91,6 +91,7 @@ { $src = "$($this.SolutionRoot)\src" $log = "$($this.BuildTemp)\belle.log" + Write-Host "Compile Belle" Write-Host "Logging to $log" @@ -352,6 +353,14 @@ "-x!dotless.Core.*" "-x!Content_Types.xml" "-x!*.pdb" ` > $null if (-not $?) { throw "Failed to zip UmbracoCms." } + + Write-Host "Zip cms cloud" + $this.CopyFile("$($this.SolutionRoot)\build\NuSpecs\tools\Web.config.cloud.xdt", "$tmp\WebApp\Web.config.install.xdt") + &$this.BuildEnv.Zip a -r "$out\UmbracoCms.$($this.Version.Semver).Cloud.zip" ` + "$tmp\WebApp\*" ` + "-x!dotless.Core.*" "-x!Content_Types.xml" "-x!*.pdb" ` + > $null + if (-not $?) { throw "Failed to zip UmbracoCms." } }) $ubuild.DefineMethod("PrepareBuild", From 22c49398e39b3d8e7f6d4479a090ad12cfcb1802 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Fri, 20 Aug 2021 15:59:31 +0200 Subject: [PATCH 06/13] Hide backdrop when closing/select navigation (#10907) (cherry picked from commit 72d33b8f6845fb4f3c713dd5f463509235557c52) # Conflicts: # src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js # src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js --- .../components/tree/umbtree.directive.js | 16 +--------- .../src/common/services/navigation.service.js | 31 ++++++++++++------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js index 7868f79809..a39475f4da 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js @@ -3,7 +3,7 @@ * @name umbraco.directives.directive:umbTree * @restrict E **/ -function umbTreeDirective($q, $rootScope, treeService, notificationsService, userService, backdropService) { +function umbTreeDirective($q, treeService, notificationsService) { return { restrict: 'E', @@ -318,18 +318,6 @@ function umbTreeDirective($q, $rootScope, treeService, notificationsService, use } } - // Close any potential backdrop and remove the #leftcolumn modifier class - function closeBackdrop() { - var aboveClass = 'above-backdrop'; - var leftColumn = $('#leftcolumn'); - var isLeftColumnOnTop = leftColumn.hasClass(aboveClass); - - if(isLeftColumnOnTop){ - backdropService.close(); - leftColumn.removeClass(aboveClass); - } - } - /** Returns the css classses assigned to the node (div element) */ $scope.getNodeCssClass = function (node) { if (!node) { @@ -369,8 +357,6 @@ function umbTreeDirective($q, $rootScope, treeService, notificationsService, use defined on the tree */ $scope.select = function (n, ev) { - - closeBackdrop() if (n.metaData && n.metaData.noAccess === true) { ev.preventDefault(); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index c628e3a5b1..c8553ec02a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -30,7 +30,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService var element = $(args.element); element.addClass('above-backdrop'); }); - + //A list of query strings defined that when changed will not cause a reload of the route var nonRoutingQueryStrings = ["mculture", "cculture", "csegment", "lq", "sr"]; @@ -118,19 +118,28 @@ function navigationService($routeParams, $location, $q, $injector, eventsService } function closeBackdrop() { - var aboveClass = 'above-backdrop'; - var leftColumn = $('#leftcolumn'); - var isLeftColumnOnTop = leftColumn.hasClass(aboveClass); - if(isLeftColumnOnTop){ - backdropService.close(); - leftColumn.removeClass(aboveClass); + var tourIsOpen = document.body.classList.contains("umb-tour-is-visible"); + if (tourIsOpen) { + return; + } + + var aboveClass = "above-backdrop"; + var leftColumn = document.getElementById("leftcolumn"); + + if (leftColumn) { + var isLeftColumnOnTop = leftColumn.classList.contains(aboveClass); + + if (isLeftColumnOnTop) { + backdropService.close(); + leftColumn.classList.remove(aboveClass); + } } } function showBackdrop() { var backDropOptions = { - 'element': $('#leftcolumn')[0] + 'element': document.getElementById('leftcolumn') }; backdropService.open(backDropOptions); } @@ -328,7 +337,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService appState.setGlobalState("showTray", false); }, - /** + /** * @ngdoc method * @name umbraco.services.navigationService#syncTree * @methodOf umbraco.services.navigationService @@ -361,14 +370,14 @@ function navigationService($routeParams, $location, $q, $injector, eventsService }); }, - /** + /** * @ngdoc method * @name umbraco.services.navigationService#hasTree * @methodOf umbraco.services.navigationService * * @description * Checks if a tree with the given alias exists. - * + * * @param {String} treeAlias the tree alias to check */ hasTree: function (treeAlias) { From c72cb1683b9626c4a38a68c08a4c959ca85b1778 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 23 Aug 2021 11:01:53 +0200 Subject: [PATCH 07/13] Removes unneeded flex that caused an issue with the image cropper datatype Fixes #10876 --- src/Umbraco.Web.UI.Client/src/less/property-editors.less | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index 11d11c7e3a..15c62b014b 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -600,7 +600,6 @@ display: inline-block; position: relative; vertical-align: top; - flex:0; } .umb-cropper-gravity .gravity-container { From 42c59a91cafb4acb0bd12a7a4efae7314ac310dd Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 23 Aug 2021 11:14:27 +0200 Subject: [PATCH 08/13] Bump version to 8.16.0 --- src/SolutionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 56e0376196..156b91187f 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -19,4 +19,4 @@ using System.Resources; // these are FYI and changed automatically [assembly: AssemblyFileVersion("8.16.0")] -[assembly: AssemblyInformationalVersion("8.16.0-rc")] +[assembly: AssemblyInformationalVersion("8.16.0")] From 82fc05ac5125add0ae5f02ccdbfef2ddc073ff37 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 23 Aug 2021 14:48:49 +0200 Subject: [PATCH 09/13] Cannot copy page with Block List block with property that 'looks like' JSON #10879 (#10925) (cherry picked from commit cd6cb3737e54118d83fd3d76fe750e2689620a8a) --- .../Compose/BlockEditorComponent.cs | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Compose/BlockEditorComponent.cs b/src/Umbraco.Web/Compose/BlockEditorComponent.cs index a8b4cfb8ca..ac92aa6918 100644 --- a/src/Umbraco.Web/Compose/BlockEditorComponent.cs +++ b/src/Umbraco.Web/Compose/BlockEditorComponent.cs @@ -5,6 +5,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Umbraco.Core; using Umbraco.Core.Composing; +using Umbraco.Core.Logging; using Umbraco.Core.Models.Blocks; using Umbraco.Core.PropertyEditors; @@ -17,6 +18,17 @@ namespace Umbraco.Web.Compose { private ComplexPropertyEditorContentEventHandler _handler; private readonly BlockListEditorDataConverter _converter = new BlockListEditorDataConverter(); + private readonly ILogger _logger; + + [Obsolete("Use the ctor injecting dependencies.")] + public BlockEditorComponent() : this(Current.Logger) + { + } + + public BlockEditorComponent(ILogger logger) + { + _logger = logger; + } public void Initialize() { @@ -116,8 +128,23 @@ namespace Umbraco.Web.Compose // this gets a little ugly because there could be some other complex editor that contains another block editor // and since we would have no idea how to parse that, all we can do is try JSON Path to find another block editor // of our type - var json = JToken.Parse(asString); - if (ProcessJToken(json, createGuid, out var result)) + JToken json = null; + try + { + json = JToken.Parse(asString); + } + catch (Exception e) + { + // See issue https://github.com/umbraco/Umbraco-CMS/issues/10879 + // We are detecting JSON data by seeing if a string is surrounded by [] or {} + // If people enter text like [PLACEHOLDER] JToken parsing fails, it's safe to ignore though + // Logging this just in case in the future we find values that are not safe to ignore + _logger.Warn( + "The property {PropertyAlias} on content type {ContentTypeKey} has a value of: {BlockItemValue} - this was recognized as JSON but could not be parsed", + data.Key, propertyAliasToBlockItemData.Key, asString); + } + + if (json != null && ProcessJToken(json, createGuid, out var result)) { // need to re-save this back to the RawPropertyValues data.RawPropertyValues[propertyAliasToBlockItemData.Key] = result; From d085b117524033d4293cb449ebd1667a7c2319d4 Mon Sep 17 00:00:00 2001 From: Chad Date: Tue, 24 Aug 2021 00:44:48 +1200 Subject: [PATCH 10/13] DIspose Process (#10918) (cherry picked from commit a2dab5b6caaf55e221fbbdea5b021c6d343c0000) --- src/Umbraco.Core/Diagnostics/MiniDump.cs | 28 ++++++++++--------- src/Umbraco.Core/Persistence/LocalDb.cs | 17 ++++++----- .../Sync/DatabaseServerMessenger.cs | 10 ++++++- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/Umbraco.Core/Diagnostics/MiniDump.cs b/src/Umbraco.Core/Diagnostics/MiniDump.cs index e8c2e82f94..ca9596b4ae 100644 --- a/src/Umbraco.Core/Diagnostics/MiniDump.cs +++ b/src/Umbraco.Core/Diagnostics/MiniDump.cs @@ -79,24 +79,26 @@ namespace Umbraco.Core.Diagnostics private static bool Write(SafeHandle fileHandle, Option options, bool withException = false) { - var currentProcess = Process.GetCurrentProcess(); - var currentProcessHandle = currentProcess.Handle; - var currentProcessId = (uint)currentProcess.Id; + using (var currentProcess = Process.GetCurrentProcess()) + { + var currentProcessHandle = currentProcess.Handle; + var currentProcessId = (uint)currentProcess.Id; - MiniDumpExceptionInformation exp; + MiniDumpExceptionInformation exp; - exp.ThreadId = GetCurrentThreadId(); - exp.ClientPointers = false; - exp.ExceptionPointers = IntPtr.Zero; + exp.ThreadId = GetCurrentThreadId(); + exp.ClientPointers = false; + exp.ExceptionPointers = IntPtr.Zero; - if (withException) - exp.ExceptionPointers = Marshal.GetExceptionPointers(); + if (withException) + exp.ExceptionPointers = Marshal.GetExceptionPointers(); - var bRet = exp.ExceptionPointers == IntPtr.Zero - ? MiniDumpWriteDump(currentProcessHandle, currentProcessId, fileHandle, (uint) options, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero) - : MiniDumpWriteDump(currentProcessHandle, currentProcessId, fileHandle, (uint) options, ref exp, IntPtr.Zero, IntPtr.Zero); + var bRet = exp.ExceptionPointers == IntPtr.Zero + ? MiniDumpWriteDump(currentProcessHandle, currentProcessId, fileHandle, (uint)options, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero) + : MiniDumpWriteDump(currentProcessHandle, currentProcessId, fileHandle, (uint)options, ref exp, IntPtr.Zero, IntPtr.Zero); - return bRet; + return bRet; + } } public static bool Dump(Option options = Option.WithFullMemory, bool withException = false) diff --git a/src/Umbraco.Core/Persistence/LocalDb.cs b/src/Umbraco.Core/Persistence/LocalDb.cs index 55d6565344..0e1da4c0d1 100644 --- a/src/Umbraco.Core/Persistence/LocalDb.cs +++ b/src/Umbraco.Core/Persistence/LocalDb.cs @@ -901,7 +901,7 @@ namespace Umbraco.Core.Persistence return -1; } - var p = new Process + using (var p = new Process { StartInfo = { @@ -913,13 +913,16 @@ namespace Umbraco.Core.Persistence CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden } - }; - p.Start(); - output = p.StandardOutput.ReadToEnd(); - error = p.StandardError.ReadToEnd(); - p.WaitForExit(); + }) + { + p.Start(); + output = p.StandardOutput.ReadToEnd(); + error = p.StandardError.ReadToEnd(); + p.WaitForExit(); - return p.ExitCode; + return p.ExitCode; + } + } /// diff --git a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs index 75ccf5e4f9..1cfca49160 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs @@ -535,10 +535,18 @@ namespace Umbraco.Core.Sync /// protected static readonly string LocalIdentity = NetworkHelper.MachineName // eg DOMAIN\SERVER + "/" + HttpRuntime.AppDomainAppId // eg /LM/S3SVC/11/ROOT - + " [P" + Process.GetCurrentProcess().Id // eg 1234 + + " [P" + GetProcessId() // eg 1234 + "/D" + AppDomain.CurrentDomain.Id // eg 22 + "] " + Guid.NewGuid().ToString("N").ToUpper(); // make it truly unique + private static int GetProcessId() + { + using(var p = Process.GetCurrentProcess()) + { + return p.Id; + } + } + private string GetDistCacheFilePath(IGlobalSettings globalSettings) { var fileName = HttpRuntime.AppDomainAppId.ReplaceNonAlphanumericChars(string.Empty) + "-lastsynced.txt"; From 8b685a0a2c626c422f67616b73ea8d0e55a5d06f Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Sun, 22 Aug 2021 15:40:44 +1200 Subject: [PATCH 11/13] Update Serilog.Enrichers.Process to 2.0.2 as it fixes a leak (cherry picked from commit dcc533fd8dba44bb4cd7feebd609bed40fe7d271) --- build/NuSpecs/UmbracoCms.Core.nuspec | 2 +- src/Umbraco.Core/Umbraco.Core.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index c94def143b..a55eff33a9 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -33,7 +33,7 @@ - + diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 146197c4f8..7a65d75578 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -97,7 +97,7 @@ 2.10.0 - 2.0.1 + 2.0.2 3.1.0 From 14a94f0ba59c7c8131bfc5c3e9eb00b8bc0c4c3e Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Tue, 24 Aug 2021 06:41:57 +1000 Subject: [PATCH 12/13] Merge pull request #10847 from umbraco/v8/bugfix/backport-fix-for-10774-into-v8 Backport fix for #10774 to v8 (cherry picked from commit 88f17b7cbfdc9073ef20d15ca503ec76a2ebf6b0) --- .../NuCache/PublishedSnapshotService.cs | 69 ++----------------- 1 file changed, 5 insertions(+), 64 deletions(-) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs index f3373dab6c..7678563a53 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs @@ -347,28 +347,6 @@ namespace Umbraco.Web.PublishedCache.NuCache return path; } - private void DeleteLocalFilesForContent() - { - if (_isReady && _localContentDb != null) - throw new InvalidOperationException("Cannot delete local files while the cache uses them."); - - var path = GetLocalFilesPath(); - var localContentDbPath = Path.Combine(path, "NuCache.Content.db"); - if (File.Exists(localContentDbPath)) - File.Delete(localContentDbPath); - } - - private void DeleteLocalFilesForMedia() - { - if (_isReady && _localMediaDb != null) - throw new InvalidOperationException("Cannot delete local files while the cache uses them."); - - var path = GetLocalFilesPath(); - var localMediaDbPath = Path.Combine(path, "NuCache.Media.db"); - if (File.Exists(localMediaDbPath)) - File.Delete(localMediaDbPath); - } - #endregion #region Environment @@ -660,38 +638,13 @@ namespace Umbraco.Web.PublishedCache.NuCache #region Handle Notifications - // note: if the service is not ready, ie _isReady is false, then notifications are ignored - - // SetUmbracoVersionStep issues a DistributedCache.Instance.RefreshAll...() call which should cause - // the entire content, media etc caches to reload from database -- and then the app restarts -- however, - // at the time SetUmbracoVersionStep runs, Umbraco is not fully initialized and therefore some property - // value converters, etc are not registered, and rebuilding the NuCache may not work properly. - // - // More details: ApplicationContext.IsConfigured being false, ApplicationEventHandler.ExecuteWhen... is - // called and in most cases events are skipped, so property value converters are not registered or - // removed, so PublishedPropertyType either initializes with the wrong converter, or throws because it - // detects more than one converter for a property type. - // - // It's not an issue for XmlStore - the app restart takes place *after* the install has refreshed the - // cache, and XmlStore just writes a new umbraco.config file upon RefreshAll, so that's OK. - // - // But for NuCache... we cannot rebuild the cache now. So it will NOT work and we are not fixing it, - // because now we should ALWAYS run with the database server messenger, and then the RefreshAll will - // be processed as soon as we are configured and the messenger processes instructions. - // note: notifications for content type and data type changes should be invoked with the // pure live model factory, if any, locked and refreshed - see ContentTypeCacheRefresher and // DataTypeCacheRefresher public override void Notify(ContentCacheRefresher.JsonPayload[] payloads, out bool draftChanged, out bool publishedChanged) { - // no cache, trash everything - if (_isReady == false) - { - DeleteLocalFilesForContent(); - draftChanged = publishedChanged = true; - return; - } + EnsureCaches(); using (_contentStore.GetScopedWriteLock(_scopeProvider)) { @@ -785,13 +738,7 @@ namespace Umbraco.Web.PublishedCache.NuCache /// public override void Notify(MediaCacheRefresher.JsonPayload[] payloads, out bool anythingChanged) { - // no cache, trash everything - if (_isReady == false) - { - DeleteLocalFilesForMedia(); - anythingChanged = true; - return; - } + EnsureCaches(); using (_mediaStore.GetScopedWriteLock(_scopeProvider)) { @@ -878,9 +825,7 @@ namespace Umbraco.Web.PublishedCache.NuCache /// public override void Notify(ContentTypeCacheRefresher.JsonPayload[] payloads) { - // no cache, nothing we can do - if (_isReady == false) - return; + EnsureCaches(); foreach (var payload in payloads) _logger.Debug("Notified {ChangeTypes} for {ItemType} {ItemId}", payload.ChangeTypes, payload.ItemType, payload.Id); @@ -960,9 +905,7 @@ namespace Umbraco.Web.PublishedCache.NuCache public override void Notify(DataTypeCacheRefresher.JsonPayload[] payloads) { - // no cache, nothing we can do - if (_isReady == false) - return; + EnsureCaches(); var idsA = payloads.Select(x => x.Id).ToArray(); @@ -1000,9 +943,7 @@ namespace Umbraco.Web.PublishedCache.NuCache public override void Notify(DomainCacheRefresher.JsonPayload[] payloads) { - // no cache, nothing we can do - if (_isReady == false) - return; + EnsureCaches(); // see note in LockAndLoadContent using (_domainStore.GetScopedWriteLock(_scopeProvider)) From e558d11fa9758041b2ad9ffbe28722c57c21bd57 Mon Sep 17 00:00:00 2001 From: Paul Johnson Date: Tue, 24 Aug 2021 14:42:08 +0100 Subject: [PATCH 13/13] Revert "Optimization by returning the same instance" This reverts commit 990fc118cbd6df423be2107a75970a834ade1f76. When using the _reusableEditor field to create a BlockEditorPropertyEditor it doesn't matter that content type cache has been invalidated (memory cache) as the content types are also cached in a private field in the BlockEditorValues class. Closes #10910 (cherry picked from commit 94b0b252ece607c9ea6fff4e417635623ee1803e) --- src/Umbraco.Core/PropertyEditors/DataEditor.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Umbraco.Core/PropertyEditors/DataEditor.cs b/src/Umbraco.Core/PropertyEditors/DataEditor.cs index d927d10052..add523ecf6 100644 --- a/src/Umbraco.Core/PropertyEditors/DataEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/DataEditor.cs @@ -19,7 +19,6 @@ namespace Umbraco.Core.PropertyEditors public class DataEditor : IDataEditor { private IDictionary _defaultConfiguration; - private IDataValueEditor _reusableEditor; /// /// Initializes a new instance of the class. @@ -91,8 +90,7 @@ namespace Umbraco.Core.PropertyEditors /// simple enough for now. /// // TODO: point of that one? shouldn't we always configure? - public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? (_reusableEditor ?? (_reusableEditor = CreateValueEditor())); - + public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? CreateValueEditor(); /// ///