Skip to content

V17/image upload mapper#959

Merged
KevinJump merged 6 commits into
v17/mainfrom
v17/image-upload-mapper
May 28, 2026
Merged

V17/image upload mapper#959
KevinJump merged 6 commits into
v17/mainfrom
v17/image-upload-mapper

Conversation

@KevinJump
Copy link
Copy Markdown
Owner

Splits the imageCropper and ImageUploadMapper into two different mappers.

  • previously we handled these two controls as one, because the image cropper could contain the same structure (a simple string) as the image upload.
  • but in reality the image cropper should be a JSON string, and the upload is just a string.
  • normalize string media paths into JSON croppers for consistancy. #812 fixed cropper inconsistencies (turned the string into JSON) but this causes problems for the image upload.
  • rather than code a condition we have separated the mappers and given them a shared base,
  • this resolved the issue now and keeps the code clean

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR separates image cropper and image upload value mapping so croppers continue to use JSON cropper payloads while upload fields remain plain strings.

Changes:

  • Introduces a shared ImagePathMapperBase for media path rewriting and dependency discovery.
  • Narrows ImagePathMapper to image cropper editors and adds ImageUploadMapper for upload fields.
  • Updates block JSON expansion behavior and bumps selected Umbraco package versions/schema outputs.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
uSync.Core/Mapping/Mappers/ImagePathMapperBase.cs Adds shared media path and dependency handling for image-related mappers.
uSync.Core/Mapping/Mappers/ImagePathMapper.cs Refactors cropper mapper to inherit shared logic and only target image cropper editors.
uSync.Core/Mapping/Mappers/ImageUploadMapper.cs Adds upload-field mapper that preserves plain string upload paths.
uSync.Core/Mapping/SyncBlockMapperBase.cs Expands nested JSON strings during import property conversion.
Directory.Packages.props Bumps selected Umbraco package versions.
uSync.Tests/packages.lock.json Updates requested Umbraco.Cms version in the test lock file.
uSync.Tests/appsettings-schema.json Regenerates schema text with escaped Unicode sequences.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread uSync.Tests/packages.lock.json
Comment thread uSync.Core/Mapping/Mappers/ImagePathMapper.cs Outdated
KevinJump and others added 4 commits May 28, 2026 11:09
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@KevinJump KevinJump merged commit 9a8d3a2 into v17/main May 28, 2026
4 checks passed
@KevinJump KevinJump deleted the v17/image-upload-mapper branch May 28, 2026 10:53
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.

2 participants