From 4fe9929061436863dc14d82801c9b523d6304682 Mon Sep 17 00:00:00 2001 From: patrickdemooij9 Date: Sun, 5 Feb 2023 16:46:45 +0100 Subject: [PATCH] Fix for checkboxlist saving --- .../Connectors/RobotsSitemapProvider.cs | 1 - .../Converters/EditorConverters/CheckboxlistConverter.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SeoToolkit.Umbraco.Core/Connectors/RobotsSitemapProvider.cs b/src/SeoToolkit.Umbraco.Core/Connectors/RobotsSitemapProvider.cs index b54cbacb..7ae3b4be 100644 --- a/src/SeoToolkit.Umbraco.Core/Connectors/RobotsSitemapProvider.cs +++ b/src/SeoToolkit.Umbraco.Core/Connectors/RobotsSitemapProvider.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; -using Polly; using SeoToolkit.Umbraco.RobotsTxt.Core.Interfaces; using System; using System.Collections.Generic; diff --git a/src/SeoToolkit.Umbraco.MetaFields.Core/Common/Converters/EditorConverters/CheckboxlistConverter.cs b/src/SeoToolkit.Umbraco.MetaFields.Core/Common/Converters/EditorConverters/CheckboxlistConverter.cs index 3b5c3cdb..29cdfd98 100644 --- a/src/SeoToolkit.Umbraco.MetaFields.Core/Common/Converters/EditorConverters/CheckboxlistConverter.cs +++ b/src/SeoToolkit.Umbraco.MetaFields.Core/Common/Converters/EditorConverters/CheckboxlistConverter.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json.Linq; using SeoToolkit.Umbraco.MetaFields.Core.Interfaces.Converters; +using System.Linq; namespace SeoToolkit.Umbraco.MetaFields.Core.Common.Converters.EditorConverters { @@ -14,7 +15,7 @@ public object ConvertDatabaseToObject(object value) public object ConvertEditorToDatabaseValue(object value) { - if (!(value is JArray array) || array.Count == 0) return null; + if (!(value is JArray array) || array.Count == 0 || array.All(it => string.IsNullOrWhiteSpace(it.ToString()))) return null; return string.Join(',', array); }