From d2dc8e047dd12ad9fb531045d5a1ef63a916329b Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Mon, 16 Jun 2025 22:01:24 +0200 Subject: [PATCH] Further fix to configuration classes using ISet, resolving regression with custom 404 pages. --- src/Umbraco.Core/CompatibilitySuppressions.xml | 11 +++++++++++ .../Configuration/Models/ContentSettings.cs | 2 +- .../Validation/ContentSettingsValidatorTests.cs | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 src/Umbraco.Core/CompatibilitySuppressions.xml diff --git a/src/Umbraco.Core/CompatibilitySuppressions.xml b/src/Umbraco.Core/CompatibilitySuppressions.xml new file mode 100644 index 000000000000..3cd59acc387e --- /dev/null +++ b/src/Umbraco.Core/CompatibilitySuppressions.xml @@ -0,0 +1,11 @@ + + + + + CP0002 + M:Umbraco.Cms.Core.Configuration.Models.ContentSettings.get_Error404Collection + lib/net9.0/Umbraco.Core.dll + lib/net9.0/Umbraco.Core.dll + true + + \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/Models/ContentSettings.cs b/src/Umbraco.Core/Configuration/Models/ContentSettings.cs index 3e89369f000d..6df9b429e907 100644 --- a/src/Umbraco.Core/Configuration/Models/ContentSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/ContentSettings.cs @@ -50,7 +50,7 @@ public class ContentSettings /// /// Gets or sets a value for the collection of error pages. /// - public ISet Error404Collection { get; set; } = new HashSet(); + public IEnumerable Error404Collection { get; set; } = []; /// /// Gets or sets a value for the preview badge mark-up. diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidatorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidatorTests.cs index bea57e67863e..1d4afe2c3bc1 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidatorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidatorTests.cs @@ -42,9 +42,9 @@ private static ContentSettings BuildContentSettings(string culture = "en-US", st new ContentSettings { Error404Collection = - { + [ new() { Culture = culture, ContentId = 1 }, - }, + ], Imaging = { AutoFillImageProperties =