Skip to content

Revive uSync.Community.DataTypeSerializers - #1052

Merged
KevinJump merged 1 commit into
v17/mainfrom
feature/community-datatype-serializers
Aug 27, 2026
Merged

Revive uSync.Community.DataTypeSerializers#1052
KevinJump merged 1 commit into
v17/mainfrom
feature/community-datatype-serializers

Conversation

@KevinJump

@KevinJump KevinJump commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Convert SyncDataTypeSerializerBase's guid/path lookups to a Try* pattern (TryUdiToEntityPath, TryGuidToEntityPath, TryPathToUdi, TryPathToGuid, TryFindItem) instead of relying on empty-string/null as failure sentinels.
  • Update ContentPickerConfigSerializer and MediaPicker3ConfigSerializer to use the new Try* methods, mapping startNodeId to a portable entity path on export and back to a guid on import.
  • Update MNTPickerConfigSerializer to map startNode.id and startNode.dynamicRoot.originKey (the latter only when present, since it isn't always set) the same way.
  • Add a new RichTextConfigSerializer mapping mediaParentId, filling a gap left by uSync.Core's built-in RichTextEditorMigratingSerializer (which only normalizes the value on import, never maps it to/from a portable path). Defensively copies the configuration dictionary before mutating, since serializers for the same editor run in a chain and RichTextEditorMigratingSerializer can hand back a read-only ImmutableSortedDictionary.

Test plan

  • dotnet build uSync.Community.DataTypeSerializers
  • Manual import/export round-trip against the sample configs in uSyncSource.Site/uSync/v17/DataTypes/ (ContentPicker, MediaPicker, MultiNodeTreePicker, MultiNodeTreePickerPlus, RichText) on a running Umbraco instance

🤖 Generated with Claude Code

…new serializers

Convert SyncDataTypeSerializerBase's guid/path lookups (UdiToEntityPath,
GuidToEntityPath, PathToUdi, PathToGuid, FindItem) to a Try* pattern instead
of relying on empty-string/null sentinels for failure.

Add/update editor config serializers that map node references to portable
entity paths on export and back to guids on import:
- ContentPickerConfigSerializer (startNodeId)
- MediaPicker3ConfigSerializer (startNodeId)
- MNTPickerConfigSerializer (startNode.id, startNode.dynamicRoot.originKey,
  the latter only mapped when present)
- RichTextConfigSerializer (mediaParentId) - new, defensively copies the
  configuration dictionary before mutating since other serializers for the
  same editor (e.g. uSync.Core's RichTextEditorMigratingSerializer) can hand
  back a read-only ImmutableSortedDictionary.
@KevinJump

Copy link
Copy Markdown
Owner Author

#1051

@KevinJump
KevinJump merged commit b6c7416 into v17/main Aug 27, 2026
4 checks passed
KevinJump added a commit that referenced this pull request Aug 27, 2026
…new serializers (#1052) (#1053)

Convert SyncDataTypeSerializerBase's guid/path lookups (UdiToEntityPath,
GuidToEntityPath, PathToUdi, PathToGuid, FindItem) to a Try* pattern instead
of relying on empty-string/null sentinels for failure.

Add/update editor config serializers that map node references to portable
entity paths on export and back to guids on import:
- ContentPickerConfigSerializer (startNodeId)
- MediaPicker3ConfigSerializer (startNodeId)
- MNTPickerConfigSerializer (startNode.id, startNode.dynamicRoot.originKey,
  the latter only mapped when present)
- RichTextConfigSerializer (mediaParentId) - new, defensively copies the
  configuration dictionary before mutating since other serializers for the
  same editor (e.g. uSync.Core's RichTextEditorMigratingSerializer) can hand
  back a read-only ImmutableSortedDictionary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant