1
- using System . Collections . Concurrent ;
1
+ using System . Collections . Concurrent ;
2
2
using Umbraco . Cms . Core . Cache ;
3
3
using Umbraco . Cms . Core . Collections ;
4
4
using Umbraco . Cms . Core . Models ;
@@ -21,6 +21,8 @@ internal sealed class PublishedProperty : PublishedPropertyBase
21
21
private readonly ContentVariation _variations ;
22
22
private readonly ContentVariation _sourceVariations ;
23
23
24
+ private readonly string _propertyTypeAlias ;
25
+
24
26
// the variant and non-variant object values
25
27
private bool _interInitialized ;
26
28
private object ? _interValue ;
@@ -71,6 +73,8 @@ public PublishedProperty(
71
73
// it must be set to the union of variance (the combination of content type and property type variance).
72
74
_variations = propertyType . Variations | content . ContentType . Variations ;
73
75
_sourceVariations = propertyType . Variations ;
76
+
77
+ _propertyTypeAlias = propertyType . Alias ;
74
78
}
75
79
76
80
// used to cache the CacheValues of this property
@@ -89,7 +93,7 @@ private static string PropertyCacheValues(Guid contentUid, string typeAlias, boo
89
93
// determines whether a property has value
90
94
public override bool HasValue ( string ? culture = null , string ? segment = null )
91
95
{
92
- _content . VariationContextAccessor . ContextualizeVariation ( _variations , _content . Id , ref culture , ref segment ) ;
96
+ _content . VariationContextAccessor . ContextualizeVariation ( _variations , _content . Id , _propertyTypeAlias , ref culture , ref segment ) ;
93
97
94
98
var value = GetSourceValue ( culture , segment ) ;
95
99
var hasValue = PropertyType . IsValue ( value , PropertyValueLevel . Source ) ;
@@ -103,7 +107,7 @@ public override bool HasValue(string? culture = null, string? segment = null)
103
107
104
108
public override object ? GetSourceValue ( string ? culture = null , string ? segment = null )
105
109
{
106
- _content . VariationContextAccessor . ContextualizeVariation ( _sourceVariations , _content . Id , ref culture , ref segment ) ;
110
+ _content . VariationContextAccessor . ContextualizeVariation ( _sourceVariations , _content . Id , _propertyTypeAlias , ref culture , ref segment ) ;
107
111
108
112
// source values are tightly bound to the property/schema culture and segment configurations, so we need to
109
113
// sanitize the contextualized culture/segment states before using them to access the source values.
@@ -146,7 +150,7 @@ public override bool HasValue(string? culture = null, string? segment = null)
146
150
147
151
public override object ? GetValue ( string ? culture = null , string ? segment = null )
148
152
{
149
- _content . VariationContextAccessor . ContextualizeVariation ( _variations , _content . Id , ref culture , ref segment ) ;
153
+ _content . VariationContextAccessor . ContextualizeVariation ( _variations , _content . Id , _propertyTypeAlias , ref culture , ref segment ) ;
150
154
151
155
object ? value ;
152
156
CacheValue cacheValues = GetCacheValues ( PropertyType . CacheLevel ) . For ( culture , segment ) ;
@@ -209,7 +213,7 @@ private CacheValues GetCacheValues(IAppCache? cache)
209
213
210
214
public override object ? GetDeliveryApiValue ( bool expanding , string ? culture = null , string ? segment = null )
211
215
{
212
- _content . VariationContextAccessor . ContextualizeVariation ( _variations , _content . Id , ref culture , ref segment ) ;
216
+ _content . VariationContextAccessor . ContextualizeVariation ( _variations , _content . Id , _propertyTypeAlias , ref culture , ref segment ) ;
213
217
214
218
object ? value ;
215
219
CacheValue cacheValues = GetCacheValues ( expanding ? PropertyType . DeliveryApiCacheLevelForExpansion : PropertyType . DeliveryApiCacheLevel ) . For ( culture , segment ) ;
0 commit comments