Skip to content

Commit

Permalink
Fix for checkboxlist saving
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdemooij9 committed Feb 5, 2023
1 parent 1a9ecea commit 4fe9929
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -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);
}

Expand Down

0 comments on commit 4fe9929

Please sign in to comment.