Skip to content

Save blueprints via SaveBlueprint on the bulk save path (v17 backport) - #1037

Merged
KevinJump merged 2 commits into
v17/mainfrom
fix/blueprint-bulk-save-object-type
Aug 14, 2026
Merged

Save blueprints via SaveBlueprint on the bulk save path (v17 backport)#1037
KevinJump merged 2 commits into
v17/mainfrom
fix/blueprint-bulk-save-object-type

Conversation

@KevinJump

@KevinJump KevinJump commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Backport of #1035 to v17/main, fixing #1034.

ContentTemplateSerializer overrides SaveItemAsync to save through IContentService.SaveBlueprint, but inherits SaveAsync(IEnumerable<IContent>) from ContentSerializer, which saves through IContentService.Save.

SyncHandlerRoot.PerformSecondPassImportsAsync uses that bulk overload for any item whose second pass requires a save, so blueprints get persisted via DocumentRepository. Its PersistUpdatedItem rebuilds the NodeDto with DocumentRepository.NodeObjectTypeId, rewriting umbracoNode.nodeObjectType from DocumentBlueprint to Document.

Once that happens GetBlueprintById can no longer find the item, so the next import treats it as missing and tries to insert it again — failing with a duplicate key on IX_umbracoNode_UniqueId.

This overrides SaveAsync so the bulk path also goes through SaveBlueprint, matching the v17 style already used by SaveItemAsync (uSyncTaskHelper.FromResultOf wrapper, SaveBlueprint(item, null, userId)).

Test plan

KevinJump and others added 2 commits August 14, 2026 15:37
ContentTemplateSerializer overrides SaveItemAsync to save through
IContentService.SaveBlueprint, but inherited SaveAsync(IEnumerable<IContent>)
from ContentSerializer, which saves through IContentService.Save. That
persists the blueprint via DocumentRepository, rewriting
umbracoNode.nodeObjectType from DocumentBlueprint to Document, so the next
import can no longer find it and fails with a duplicate key error.

Backport of #1035 to v17.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@KevinJump
KevinJump merged commit 8d234b9 into v17/main Aug 14, 2026
4 checks passed
@KevinJump
KevinJump deleted the fix/blueprint-bulk-save-object-type branch August 14, 2026 14:44
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