Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private IDictionary<string, object> MigrateToTipTap(IDictionary<string, object>
// update we don't skip if the toolbar is missing, i can be for some older configs
List<string> toolbarList = [];
if (configuration.TryGetValue("toolbar", out var toolbar) is false
&& TryGetToolbarArray(toolbar, out toolbarList) is false)
|| TryGetToolbarArray(toolbar, out toolbarList) is false)
{
toolbarList = _defaultToolbar.ToList();
}
Expand All @@ -113,7 +113,15 @@ private IDictionary<string, object> MigrateToTipTap(IDictionary<string, object>
private bool TryGetToolbarArray(object? toolbar, out List<string> toolBarList)
{
toolBarList = new List<string>();
if (toolbar is null || toolbar is not JsonElement jsonElement || jsonElement.ValueKind != JsonValueKind.Array)
if (toolbar is null) return false;

if (toolbar is IEnumerable<string> stringList)
{
toolBarList = stringList.ToList();
return toolBarList.Count > 0;
}

if (toolbar is not JsonElement jsonElement || jsonElement.ValueKind != JsonValueKind.Array)
return false;

toolBarList = jsonElement.EnumerateArray().Select(x => x.GetString() ?? string.Empty).ToList();
Expand Down
Empty file modified uSync.Tests/appsettings-schema.Umbraco.Cms.json
100644 → 100755
Empty file.
Empty file modified uSync.Tests/umbraco-package-schema.json
100644 → 100755
Empty file.