From 3667217053b9643d6369fe360ed7f012c12ffdf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 17 Sep 2024 09:51:47 +0200 Subject: [PATCH 1/5] only resolve if value is present (#17070) --- .../src/common/services/rte-blockeditor-clipboard.service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/rte-blockeditor-clipboard.service.js b/src/Umbraco.Web.UI.Client/src/common/services/rte-blockeditor-clipboard.service.js index 216b7fe1e860..0a1aee1f277c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/rte-blockeditor-clipboard.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/rte-blockeditor-clipboard.service.js @@ -50,13 +50,13 @@ function rawRteBlockResolver(propertyValue, propPasteResolverMethod) { - if (propertyValue != null && typeof propertyValue === "object") { + if (propertyValue && typeof propertyValue === "object" && propertyValue.markup) { // object property of 'blocks' holds the data for the Block Editor. var value = propertyValue.blocks; // we got an object, and it has these three props then we are most likely dealing with a Block Editor. - if ((value.layout !== undefined && value.contentData !== undefined && value.settingsData !== undefined)) { + if ((value && value.layout !== undefined && value.contentData !== undefined && value.settingsData !== undefined)) { // replaceUdisOfObject replaces udis of the value object(by instance reference), but also returns the updated markup (as we cant update the reference of a string). propertyValue.markup = replaceUdisOfObject(value.layout, value, propertyValue.markup); From d58768f26d1db7bf6b6a4628c10f7aa61012ad94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 17 Sep 2024 09:52:00 +0200 Subject: [PATCH 2/5] utilize lock unlock events for readonly mode while saving (#17077) --- .../components/content/edit.controller.js | 7 +++++-- .../content/umbtabbedcontent.directive.js | 13 ++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 8a8ae0a36b5d..e3b3ba413c51 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -5,7 +5,7 @@ appState, contentResource, entityResource, navigationService, notificationsService, contentAppHelper, serverValidationManager, contentEditingHelper, localizationService, formHelper, umbRequestHelper, editorState, $http, eventsService, overlayService, $location, localStorageService, treeService, - $exceptionHandler, uploadTracker) { + $exceptionHandler, uploadTracker) { var evts = []; var infiniteMode = $scope.infiniteModel && $scope.infiniteModel.infiniteMode; @@ -497,6 +497,7 @@ //Set them all to be invalid var fieldsToRollback = checkValidility(); eventsService.emit("content.saving", { content: $scope.content, action: args.action }); + eventsService.emit("form.lock"); return contentEditingHelper.contentEditorPerformSave({ saveMethod: args.saveMethod, @@ -517,6 +518,7 @@ syncTreeNode($scope.content, data.path, false, args.reloadChildren); eventsService.emit("content.saved", { content: $scope.content, action: args.action, valid: true }); + eventsService.emit("form.unlock"); if($scope.contentForm.$invalid !== true) { resetNestedFieldValiation(fieldsToRollback); @@ -534,6 +536,7 @@ if (err && err.status === 400 && err.data) { // content was saved but is invalid. eventsService.emit("content.saved", { content: $scope.content, action: args.action, valid: false }); + eventsService.emit("form.unlock"); } return $q.reject(err); @@ -1002,7 +1005,7 @@ const openPreviewWindow = (url, target) => { // Chromes popup blocker will kick in if a window is opened // without the initial scoped request. This trick will fix that. - + const previewWindow = $window.open(url, target); previewWindow.addEventListener('load', () => { diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js index f003e1afa633..e76da32a545b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js @@ -2,7 +2,7 @@ 'use strict'; /** This directive is used to render out the current variant tabs and properties and exposes an API for other directives to consume */ - function tabbedContentDirective($timeout, $filter, contentEditingHelper, contentTypeHelper) { + function tabbedContentDirective($timeout, $filter, contentEditingHelper, contentTypeHelper, eventsService) { function link($scope, $element) { @@ -156,14 +156,13 @@ } }); - $scope.$on("formSubmitting", function() { - $scope.allowUpdate = false; + eventsService.on("form.lock", function() { + $scope.$evalAsync(() => { + $scope.allowUpdate = false; + }); }); - $scope.$on("formSubmitted", function() { - setAllowUpdate(); - }); - $scope.$on("formSubmittedValidationFailed", function() { + eventsService.on("form.unlock", function() { setAllowUpdate(); }); From eb0f8b5c24f0e5d1dbdfc98069a874def891c833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 17 Sep 2024 10:06:16 +0200 Subject: [PATCH 3/5] fire change event (#17078) --- .../src/common/services/tinymce.service.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 18707c1f60d5..7ed6b9ee500b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -1056,6 +1056,10 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s editor.undoManager.clear(); } } + + angularHelper.safeApply($rootScope, function () { + editor.dispatch("Change"); + }); }); }); From 6a453a091060479960ddca786b748184a7ad6d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20=C3=96hman?= Date: Tue, 17 Sep 2024 13:56:58 +0200 Subject: [PATCH 4/5] v13.5 - New Swedish translation crashes Umbraco, removed duplicate areas. (#17059) Cherry-picked from d64bf5de2207798b58609f2cbe2c4a06a3b7761c --- .../EmbeddedResources/Lang/sv.xml | 3 --- .../Services/LocalizedTextService.cs | 25 +++++++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml b/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml index 0a688083eb19..47a787aada14 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml @@ -4,9 +4,6 @@ The Umbraco community https://docs.umbraco.com/umbraco-cms/extending/language-files - - InnehÄll - Hantera domÀnnamn Hantera versioner diff --git a/src/Umbraco.Core/Services/LocalizedTextService.cs b/src/Umbraco.Core/Services/LocalizedTextService.cs index 1634f60baa36..51012200bd05 100644 --- a/src/Umbraco.Core/Services/LocalizedTextService.cs +++ b/src/Umbraco.Core/Services/LocalizedTextService.cs @@ -350,7 +350,13 @@ private IDictionary> GetAreaStoredTranslatio IEnumerable areas = xmlSource[cult].Value.XPathSelectElements("//area"); foreach (XElement area in areas) { - var result = new Dictionary(StringComparer.InvariantCulture); + var areaAlias = area.Attribute("alias")!.Value; + + if (!overallResult.TryGetValue(areaAlias, out IDictionary? result)) + { + result = new Dictionary(StringComparer.InvariantCulture); + } + IEnumerable keys = area.XPathSelectElements("./key"); foreach (XElement key in keys) { @@ -364,7 +370,10 @@ private IDictionary> GetAreaStoredTranslatio } } - overallResult.Add(area.Attribute("alias")!.Value, result); + if (!overallResult.ContainsKey(areaAlias)) + { + overallResult.Add(areaAlias, result); + } } // Merge English Dictionary @@ -374,11 +383,11 @@ private IDictionary> GetAreaStoredTranslatio IEnumerable enUS = xmlSource[englishCulture].Value.XPathSelectElements("//area"); foreach (XElement area in enUS) { - IDictionary - result = new Dictionary(StringComparer.InvariantCulture); - if (overallResult.ContainsKey(area.Attribute("alias")!.Value)) + var areaAlias = area.Attribute("alias")!.Value; + + if (!overallResult.TryGetValue(areaAlias, out IDictionary? result)) { - result = overallResult[area.Attribute("alias")!.Value]; + result = new Dictionary(StringComparer.InvariantCulture); } IEnumerable keys = area.XPathSelectElements("./key"); @@ -394,9 +403,9 @@ private IDictionary> GetAreaStoredTranslatio } } - if (!overallResult.ContainsKey(area.Attribute("alias")!.Value)) + if (!overallResult.ContainsKey(areaAlias)) { - overallResult.Add(area.Attribute("alias")!.Value, result); + overallResult.Add(areaAlias, result); } } } From 842cacde1923beaa90b373dab6844c6a009f8bd7 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 17 Sep 2024 14:50:57 +0200 Subject: [PATCH 5/5] Bump version --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index ff1a0edbe511..cb406a4d2210 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "13.5.0", + "version": "13.5.1", "assemblyVersion": { "precision": "build" },