Skip to content

Conversation

@Migaroez
Copy link
Contributor

@Migaroez Migaroez commented Dec 11, 2025

Summary

  • Fixes an issue where block-level property values were polluted when changing element property variance (variant ↔ invariant) before publishing
  • When changing a block element property from variant to invariant, old culture-specific values were retained in the published JSON
  • When changing from invariant to variant, old invariant values were retained alongside new culture-specific values

These issues do not show up during rendering (delivery api or razor views) but they do show up when examine tries to index the properties. Publishing should throw an examine error.

Changes

  • Added cleanup logic in BlockValuePropertyValueEditorBase.MergePartialPropertyValueForCulture to remove stale values after merging
  • Added comprehensive integration tests for Block Grid, Block List, and Rich Text editors

Test plan

  • Added integration tests covering variant → invariant scenario
  • Added integration tests covering invariant → variant scenario
  • Tests added for all block editor types (Block Grid, Block List, Rich Text)

@Migaroez Migaroez changed the title Fix: Block level variance values polluted when changing variance before publish Fix: Block level variance values being polluted when changing variance before publish Dec 11, 2025
@Migaroez Migaroez changed the title Fix: Block level variance values being polluted when changing variance before publish Block level variance: fix values being polluted when changing variance before publish Dec 11, 2025
@AndyButland
Copy link
Contributor

I'm having trouble replicating the original issue for this PR @Migaroez. Please could you add manual testing steps (or review what I've done to see what I've missed) please?

  • Created document with a block list with single block based on an element with a single invariant property.
  • Saved some content.
  • Requested via management API and got response:
GET /umbraco/management/api/v1/document/{id}

"contentData": [
  {
	"contentTypeKey": "09598267-c79c-4abb-baf1-ae1552061d63",
	"udi": null,
	"key": "6d0675eb-06dc-40c8-bad2-dbe6473d1504",
	"values": [
	  {
		"editorAlias": "Umbraco.TextBox",
		"culture": null,
		"segment": null,
		"alias": "headline",
		"value": "The Headline"
	  }
	  ...
  • Made content type, element type and property variant.
  • Resaved and published English variant and re-requested via management API:
  {
	"editorAlias": "Umbraco.TextBox",
	"culture": "en-US",
	"segment": null,
	"alias": "headline",
	"value": "The Headline"
  }

So this seems OK - only one property, and it has the expected culture.

  • Going back the other way, have set property to be invariant.
  • Without resaving the content, I see the expected property data (only one, with expected null culture).
  {
	"editorAlias": "Umbraco.TextBox",
	"culture": null,
	"segment": null,
	"alias": "headline",
	"value": "The Headline"
  }

Resaved and published - still looks OK.

Going back again, have set property to be variant by language, and get:

  {
	"editorAlias": "Umbraco.TextBox",
	"culture": "en-US",
	"segment": null,
	"alias": "headline",
	"value": "The Headline"
  }

Again, seems OK.

@Migaroez
Copy link
Contributor Author

Sorry bout that Andy, updated the PR with relevant info

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

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

I've not been able to replicate the issue still unfortunately, so will have to rely on you to confirm this does resolve a problem that you can see when running the code from main. I don't see an Examine error and would have expected to see the issue via the process I described in my earlier comment if invalid values remain after changing the variation status of a property.

That said, the fix itself looks good and great job on the comprehensive tests. I tried copying the tests back to main and can see that most of them fail there, so it does seem clear there is some situations where things are going wrong and this fix resolves them.

My only comments then are some minor suggestions for clean-up of test code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants