Skip to content

Commit cfbbfa0

Browse files
authored
Further fix to configuration classes using ISet, resolving regression with custom 404 pages (#19573)
Further fix to configuration classes using ISet, resolving regression with custom 404 pages.
1 parent b81d459 commit cfbbfa0

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
3+
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
4+
<Suppression>
5+
<DiagnosticId>CP0002</DiagnosticId>
6+
<Target>M:Umbraco.Cms.Core.Configuration.Models.ContentSettings.get_Error404Collection</Target>
7+
<Left>lib/net9.0/Umbraco.Core.dll</Left>
8+
<Right>lib/net9.0/Umbraco.Core.dll</Right>
9+
<IsBaselineSuppression>true</IsBaselineSuppression>
10+
</Suppression>
11+
</Suppressions>

src/Umbraco.Core/Configuration/Models/ContentSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class ContentSettings
5050
/// <summary>
5151
/// Gets or sets a value for the collection of error pages.
5252
/// </summary>
53-
public ISet<ContentErrorPage> Error404Collection { get; set; } = new HashSet<ContentErrorPage>();
53+
public IEnumerable<ContentErrorPage> Error404Collection { get; set; } = [];
5454

5555
/// <summary>
5656
/// Gets or sets a value for the preview badge mark-up.

tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidatorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ private static ContentSettings BuildContentSettings(string culture = "en-US", st
4242
new ContentSettings
4343
{
4444
Error404Collection =
45-
{
45+
[
4646
new() { Culture = culture, ContentId = 1 },
47-
},
47+
],
4848
Imaging =
4949
{
5050
AutoFillImageProperties =

0 commit comments

Comments
 (0)