Skip to content

Commit f0b50c4

Browse files
AndyButlandnielslyngsoe
authored andcommitted
Only apply validation on content update to variant cultures where the editor has permission for the culture (#18778)
* Only apply validation on content update to variant cultures where the editor has permission for the culture. * Remove inadvertent comment updates. * Fixed failing integration test.
1 parent 2b5b044 commit f0b50c4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Diff for: src/Umbraco.Core/Services/ContentEditingService.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ private async Task<IContent> EnsureOnlyAllowedFieldsAreUpdated(IContent contentW
188188
{
189189
foreach (var culture in disallowedCultures)
190190
{
191-
var currentValue = existingContent?.Properties.First(x => x.Alias == property.Alias)
192-
.GetValue(culture, null, false);
193-
property.SetValue(currentValue, culture, null);
191+
var currentValue = existingContent?.Properties.First(x => x.Alias == property.Alias)
192+
.GetValue(culture, null, false);
193+
property.SetValue(currentValue, culture, null);
194194
}
195195
}
196196

@@ -279,10 +279,10 @@ public async Task<Attempt<ContentUpdateResult, ContentEditingOperationStatus>> U
279279
=> await HandleMoveToRecycleBinAsync(key, userKey);
280280

281281
public async Task<Attempt<IContent?, ContentEditingOperationStatus>> DeleteFromRecycleBinAsync(Guid key, Guid userKey)
282-
=> await HandleDeleteAsync(key, userKey,true);
282+
=> await HandleDeleteAsync(key, userKey, true);
283283

284284
public async Task<Attempt<IContent?, ContentEditingOperationStatus>> DeleteAsync(Guid key, Guid userKey)
285-
=> await HandleDeleteAsync(key, userKey,false);
285+
=> await HandleDeleteAsync(key, userKey, false);
286286

287287
public async Task<Attempt<IContent?, ContentEditingOperationStatus>> MoveAsync(Guid key, Guid? parentKey, Guid userKey)
288288
=> await HandleMoveAsync(key, parentKey, userKey);

Diff for: src/Umbraco.Core/Services/IContentEditingService.cs

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> ValidateCr
1616
=> ValidateCreateAsync(createModel);
1717
#pragma warning restore CS0618 // Type or member is obsolete
1818

19+
[Obsolete("Please use the validate update method that is not obsoleted. Scheduled for removal in Umbraco 16.")]
20+
Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> ValidateUpdateAsync(Guid key, ContentUpdateModel updateModel);
21+
1922
[Obsolete("Please use the validate update method that is not obsoleted. Scheduled for removal in Umbraco 17.")]
2023
Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> ValidateUpdateAsync(Guid key, ValidateContentUpdateModel updateModel);
2124

0 commit comments

Comments
 (0)