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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Notable changes to uSync.Migrations. The package ships one release line per Umbraco major, so
versions track the Umbraco major they target.

## [Unreleased]

### Fixed

- The Switcher to True/False migrator renamed `hideLabel` to `showLabels` without inverting
it, so labels hidden in v7/v8 showed after migration and vice versa. It now negates the
value. ([#306](https://github.com/Jumoo/uSyncMigrations/issues/306))

## 17.0.3 - 2026-09-11

### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Umbraco.Cms.Core;
using Umbraco.Extensions;

using uSync.Core.DataTypes;
using uSync.Migrations.Core.Migrators;
Expand All @@ -14,9 +15,16 @@ public class SwitcherConfigurationMigrator : SyncConfigurationMigratorBase, ICon

public override Task<IDictionary<string, object>> GetMigratedConfigurationAsync(string name, IDictionary<string, object> configuration)
{
// hideLabel is the opposite of showLabels, so negate it. ToString() covers bool, JsonElement and JsonNode.
if (configuration.Remove("hideLabel", out var hideLabel))
{
var hide = hideLabel?.ToString().TryConvertTo<bool>();
if (hide?.Success == true)
configuration["showLabels"] = !hide.Value.Result;
}

return Task.FromResult(MigratePropertyNames(configuration, new Dictionary<string, string>
{
{ "hideLabel", "showLabels" },
{ "onLabelText", "onLabel" },
{ "offLabelText", "offLabel" },
{ "switchOn", "default" }
Expand Down
Loading