Fix: #870 - Migrate Filter and StartNodeId values for pickers from v13#873
Fix: #870 - Migrate Filter and StartNodeId values for pickers from v13#873
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #870 by implementing migration logic for picker configurations from v13 to v17. Specifically, it converts Filter values from content type aliases to GUIDs and StartNodeId values from UDI format to GUID format. The solution creates a reusable base class to share this migration logic across different picker types.
Key Changes
- Created
PickerConfigurationSerializerBase<TContentType>to centralize Filter and StartNodeId migration logic - Updated
MediaPickerConfigSerializerto inherit from the new base class and handle MediaPicker3 - Added
ContentPickerConfigSerializerwith similar migration support
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| uSync.Core/DataTypes/PickerConfigurationSerializerBase.cs | New base class implementing generic Filter (alias to GUID) and StartNodeId (UDI to GUID) conversion logic |
| uSync.Core/DataTypes/DataTypeSerializers/MediaPickerConfigSerializer.cs | Updated to inherit from base class, added MediaPicker3 support, and removed redundant GetConfigurationImport override |
| uSync.Core/DataTypes/DataTypeSerializers/ContentPickerConfigSerializer.cs | New serializer for ContentPicker with migration support via base class |
| uSync.Core/Mapping/Mappers/MediaPicker3Mapper.cs | Added IMediaTypeService dependency and minor formatting changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
uSync.Core/DataTypes/DataTypeSerializers/ContentPickerConfigSerializer.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@KevinJump I've opened a new pull request, #874, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@KevinJump I've opened a new pull request, #875, to work on those changes. Once the pull request is ready, I'll request review from you. |
…#875) * Initial plan * Add MediaPickerMigrationTests to cover Filter and StartNodeId migrations Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com>
…erializers (#874) * Initial plan * Add comprehensive migration tests for ContentPicker and MediaPicker configurations Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: KevinJump <431231+KevinJump@users.noreply.github.com> Co-authored-by: Kevin Jump <kevin@thejumps.co.uk>
Updated [uSync](https://github.com/KevinJump/uSync) from 17.0.1 to 17.0.2. <details> <summary>Release notes</summary> _Sourced from [uSync's releases](https://github.com/KevinJump/uSync/releases)._ ## 17.0.2 This is a patch release of uSync for Umbraco v17 it fixes some reported issues with tab name clashes and migrated media and content pickers that have start nodes or filters defined. ## What's Changed * Fix grammar in en-US translation by @stephlane in KevinJump/uSync#872 * Fix: #870 - Migrate Filter and StartNodeId values for pickers from v13 by @KevinJump in KevinJump/uSync#873 * Fix: #862 - Search for exact alias, not just a partial match. #862 by @KevinJump in KevinJump/uSync#876 ## New Contributors * @stephlane made their first contribution in KevinJump/uSync#872 **Full Changelog**: KevinJump/uSync@v17.0.1...v17.0.2 Commits viewable in [compare view](KevinJump/uSync@v17.0.1...v17.0.2). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fixes #870.
the
Filtervalue in old pickers contained the aliases of the items to filter a picker by. now this is the GUID of the values.The
StartNodeIdvalue in the picker was the UDI in v17 it's the GUID.this is true for media pickers and the content picker (we already do stuff for MNTP). so we have a base class they can share so we do it all.