Skip to content

Commit 638e181

Browse files
Content Types: Fix property variation change when content exists only in non-default language (#21182)
* Content Types: Fix property variation change when content exists only in non-default language (closes #11771) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add tests for AllowEditInvariantFromNonDefault enabled scenario 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 254400b commit 638e181

File tree

2 files changed

+403
-3
lines changed

2 files changed

+403
-3
lines changed

src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,9 +1439,13 @@ private void RenormalizeDocumentEditedFlags(
14391439
}
14401440
else if (ev.Key.langId.HasValue)
14411441
{
1442-
// This should never happen! If a property culture is flagged as edited then the culture must exist at the document level
1443-
throw new PanicException(
1444-
$"The existing DocumentCultureVariationDto was not found for node {ev.Key.nodeId} and language {ev.Key.langId}");
1442+
// This can happen when a property changes from invariant to variant and the content
1443+
// was only created in non-default languages. The invariant property data gets migrated
1444+
// to the default language, but no DocumentCultureVariationDto exists for the default
1445+
// language because the content was never created in that language.
1446+
// In this case, we simply skip updating the edited flag since there's no document
1447+
// culture variation record to update.
1448+
continue;
14451449
}
14461450
}
14471451

0 commit comments

Comments
 (0)