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.
This commit is contained in:
Andy Butland
2025-06-30 14:37:04 +02:00
committed by GitHub
parent b81d45901b
commit cfbbfa004c
3 changed files with 14 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Umbraco.Cms.Core.Configuration.Models.ContentSettings.get_Error404Collection</Target>
<Left>lib/net9.0/Umbraco.Core.dll</Left>
<Right>lib/net9.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>

View File

@@ -50,7 +50,7 @@ public class ContentSettings
/// <summary>
/// Gets or sets a value for the collection of error pages.
/// </summary>
public ISet<ContentErrorPage> Error404Collection { get; set; } = new HashSet<ContentErrorPage>();
public IEnumerable<ContentErrorPage> Error404Collection { get; set; } = [];
/// <summary>
/// Gets or sets a value for the preview badge mark-up.

View File

@@ -42,9 +42,9 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Configuration.Models.Validati
new ContentSettings
{
Error404Collection =
{
[
new() { Culture = culture, ContentId = 1 },
},
],
Imaging =
{
AutoFillImageProperties =