Skip to content

Read the incoming template in a content preview from the file - #1203

Merged
KevinJump merged 1 commit into
v17/mainfrom
fix/preview-template-from-file
Nov 5, 2026
Merged

KevinJump merged 1 commit into
v17/mainfrom
fix/preview-template-from-file

Conversation

@KevinJump

Copy link
Copy Markdown
Owner

Found via Jumoo/uSync.Complete#222.

Problem

Pushing content whose template isn't on the target yet: the details list Template (Blank) → allProperties, but the visual preview shows "Template -" on both sides and, with "Only show changes" on, says no values change. A pending change looks like nothing.

Cause

SyncPreviewMappingHelper.MapContentInfoAsync took the incoming template from the deserialized item. ContentSerializer.DeserializeTemplate only sets a template the site already has, so a template arriving in the same sync (or missing) came out as none.

Fix

For the incoming side, read the alias from the uSync file's Info/Template (empty means no template). When the file has no Template element, fall back to the item as before. The current side (no node) is unchanged.

Testing

Builds. No unit test: uSync.Tests doesn't reference uSync.Backoffice.Management.Api, and adding it for this pulls in the management API packages. Not yet checked in the backoffice.

🤖 Generated with Claude Code

The incoming side of the content preview took the template from the
deserialized item, which only gets one the site already has. When the template
is coming in the same sync (or is missing) the visual preview showed no
template on either side and "No values change", while the details listed the
template change. Read the alias from the uSync file's Info/Template instead,
falling back to the item when the file has no Template element.

Found via Jumoo/uSync.Complete#222.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/17.6.2 uSync 17.6.2 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant