Skip to content

Commit 2e068bb

Browse files
committed
Merge remote-tracking branch 'origin/release/13.5' into release/13.5
2 parents 842cacd + 6a453a0 commit 2e068bb

File tree

6 files changed

+34
-22
lines changed

6 files changed

+34
-22
lines changed

src/Umbraco.Core/EmbeddedResources/Lang/sv.xml

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
<name>The Umbraco community</name>
55
<link>https://docs.umbraco.com/umbraco-cms/extending/language-files</link>
66
</creator>
7-
<area alias="apps">
8-
<key alias="umbContent">Innehåll</key>
9-
</area>
107
<area alias="actions">
118
<key alias="assigndomain">Hantera domännamn</key>
129
<key alias="auditTrail">Hantera versioner</key>

src/Umbraco.Core/Services/LocalizedTextService.cs

+17-8
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,13 @@ private IDictionary<string, IDictionary<string, string>> GetAreaStoredTranslatio
350350
IEnumerable<XElement> areas = xmlSource[cult].Value.XPathSelectElements("//area");
351351
foreach (XElement area in areas)
352352
{
353-
var result = new Dictionary<string, string>(StringComparer.InvariantCulture);
353+
var areaAlias = area.Attribute("alias")!.Value;
354+
355+
if (!overallResult.TryGetValue(areaAlias, out IDictionary<string, string>? result))
356+
{
357+
result = new Dictionary<string, string>(StringComparer.InvariantCulture);
358+
}
359+
354360
IEnumerable<XElement> keys = area.XPathSelectElements("./key");
355361
foreach (XElement key in keys)
356362
{
@@ -364,7 +370,10 @@ private IDictionary<string, IDictionary<string, string>> GetAreaStoredTranslatio
364370
}
365371
}
366372

367-
overallResult.Add(area.Attribute("alias")!.Value, result);
373+
if (!overallResult.ContainsKey(areaAlias))
374+
{
375+
overallResult.Add(areaAlias, result);
376+
}
368377
}
369378

370379
// Merge English Dictionary
@@ -374,11 +383,11 @@ private IDictionary<string, IDictionary<string, string>> GetAreaStoredTranslatio
374383
IEnumerable<XElement> enUS = xmlSource[englishCulture].Value.XPathSelectElements("//area");
375384
foreach (XElement area in enUS)
376385
{
377-
IDictionary<string, string>
378-
result = new Dictionary<string, string>(StringComparer.InvariantCulture);
379-
if (overallResult.ContainsKey(area.Attribute("alias")!.Value))
386+
var areaAlias = area.Attribute("alias")!.Value;
387+
388+
if (!overallResult.TryGetValue(areaAlias, out IDictionary<string, string>? result))
380389
{
381-
result = overallResult[area.Attribute("alias")!.Value];
390+
result = new Dictionary<string, string>(StringComparer.InvariantCulture);
382391
}
383392

384393
IEnumerable<XElement> keys = area.XPathSelectElements("./key");
@@ -394,9 +403,9 @@ private IDictionary<string, IDictionary<string, string>> GetAreaStoredTranslatio
394403
}
395404
}
396405

397-
if (!overallResult.ContainsKey(area.Attribute("alias")!.Value))
406+
if (!overallResult.ContainsKey(areaAlias))
398407
{
399-
overallResult.Add(area.Attribute("alias")!.Value, result);
408+
overallResult.Add(areaAlias, result);
400409
}
401410
}
402411
}

src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
appState, contentResource, entityResource, navigationService, notificationsService, contentAppHelper,
66
serverValidationManager, contentEditingHelper, localizationService, formHelper, umbRequestHelper,
77
editorState, $http, eventsService, overlayService, $location, localStorageService, treeService,
8-
$exceptionHandler, uploadTracker) {
8+
$exceptionHandler, uploadTracker) {
99

1010
var evts = [];
1111
var infiniteMode = $scope.infiniteModel && $scope.infiniteModel.infiniteMode;
@@ -497,6 +497,7 @@
497497
//Set them all to be invalid
498498
var fieldsToRollback = checkValidility();
499499
eventsService.emit("content.saving", { content: $scope.content, action: args.action });
500+
eventsService.emit("form.lock");
500501

501502
return contentEditingHelper.contentEditorPerformSave({
502503
saveMethod: args.saveMethod,
@@ -517,6 +518,7 @@
517518
syncTreeNode($scope.content, data.path, false, args.reloadChildren);
518519

519520
eventsService.emit("content.saved", { content: $scope.content, action: args.action, valid: true });
521+
eventsService.emit("form.unlock");
520522

521523
if($scope.contentForm.$invalid !== true) {
522524
resetNestedFieldValiation(fieldsToRollback);
@@ -534,6 +536,7 @@
534536
if (err && err.status === 400 && err.data) {
535537
// content was saved but is invalid.
536538
eventsService.emit("content.saved", { content: $scope.content, action: args.action, valid: false });
539+
eventsService.emit("form.unlock");
537540
}
538541

539542
return $q.reject(err);
@@ -1002,7 +1005,7 @@
10021005
const openPreviewWindow = (url, target) => {
10031006
// Chromes popup blocker will kick in if a window is opened
10041007
// without the initial scoped request. This trick will fix that.
1005-
1008+
10061009
const previewWindow = $window.open(url, target);
10071010

10081011
previewWindow.addEventListener('load', () => {

src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'use strict';
33

44
/** This directive is used to render out the current variant tabs and properties and exposes an API for other directives to consume */
5-
function tabbedContentDirective($timeout, $filter, contentEditingHelper, contentTypeHelper) {
5+
function tabbedContentDirective($timeout, $filter, contentEditingHelper, contentTypeHelper, eventsService) {
66

77
function link($scope, $element) {
88

@@ -156,14 +156,13 @@
156156
}
157157
});
158158

159-
$scope.$on("formSubmitting", function() {
160-
$scope.allowUpdate = false;
159+
eventsService.on("form.lock", function() {
160+
$scope.$evalAsync(() => {
161+
$scope.allowUpdate = false;
162+
});
161163
});
162164

163-
$scope.$on("formSubmitted", function() {
164-
setAllowUpdate();
165-
});
166-
$scope.$on("formSubmittedValidationFailed", function() {
165+
eventsService.on("form.unlock", function() {
167166
setAllowUpdate();
168167
});
169168

src/Umbraco.Web.UI.Client/src/common/services/rte-blockeditor-clipboard.service.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@
5050

5151

5252
function rawRteBlockResolver(propertyValue, propPasteResolverMethod) {
53-
if (propertyValue != null && typeof propertyValue === "object") {
53+
if (propertyValue && typeof propertyValue === "object" && propertyValue.markup) {
5454

5555
// object property of 'blocks' holds the data for the Block Editor.
5656
var value = propertyValue.blocks;
5757

5858
// we got an object, and it has these three props then we are most likely dealing with a Block Editor.
59-
if ((value.layout !== undefined && value.contentData !== undefined && value.settingsData !== undefined)) {
59+
if ((value && value.layout !== undefined && value.contentData !== undefined && value.settingsData !== undefined)) {
6060

6161
// 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).
6262
propertyValue.markup = replaceUdisOfObject(value.layout, value, propertyValue.markup);

src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js

+4
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,10 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
10561056
editor.undoManager.clear();
10571057
}
10581058
}
1059+
1060+
angularHelper.safeApply($rootScope, function () {
1061+
editor.dispatch("Change");
1062+
});
10591063
});
10601064
});
10611065

0 commit comments

Comments
 (0)