Fix property variance cache issue (#14824)

* Property variance should be the union of variance between content type and property type

* Fix a few comments in the tests

* Review changes
This commit is contained in:
Kenn Jacobsen
2023-09-25 13:45:28 +02:00
committed by GitHub
parent d39502674e
commit ccd54bfb0e
2 changed files with 384 additions and 1 deletions

View File

@@ -86,7 +86,9 @@ internal class Property : PublishedPropertyBase
_isPreviewing = content.IsPreviewing;
_isMember = content.ContentType.ItemType == PublishedItemType.Member;
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_variations = propertyType.Variations;
// this variable is used for contextualizing the variation level when calculating property values.
// it must be set to the union of variance (the combination of content type and property type variance).
_variations = propertyType.Variations | content.ContentType.Variations;
}
// clone for previewing as draft a published content that is published and has no draft