diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedValueFallback.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedValueFallback.cs
index f30a53c8b6..4b6e7cb10a 100644
--- a/src/Umbraco.Core/Models/PublishedContent/IPublishedValueFallback.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedValueFallback.cs
@@ -94,12 +94,17 @@
/// A fallback strategy.
/// An optional default value.
/// The fallback value.
+ /// The property that does not have a value.
/// A value indicating whether a fallback value could be provided.
///
/// This method is called whenever getting the property value for the specified alias, culture and
/// segment, either returned no property at all, or a property with HasValue(culture, segment) being false.
+ /// In an , because walking up the tree is possible, the content itself may not even
+ /// have a property with the specified alias, but such a property may exist up in the tree. The
+ /// parameter is used to return a property with no value. That can then be used to invoke a converter and get the
+ /// converter's interpretation of "no value".
///
- bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, object defaultValue, out object value);
+ bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, object defaultValue, out object value, out IPublishedProperty noValueProperty);
///
/// Tries to get a fallback value for a published content property.
@@ -117,6 +122,6 @@
/// This method is called whenever getting the property value for the specified alias, culture and
/// segment, either returned no property at all, or a property with HasValue(culture, segment) being false.
///
- bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, T defaultValue, out T value);
+ bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, T defaultValue, out T value, out IPublishedProperty noValueProperty);
}
}
diff --git a/src/Umbraco.Core/Models/PublishedContent/NoopPublishedValueFallback.cs b/src/Umbraco.Core/Models/PublishedContent/NoopPublishedValueFallback.cs
index cd7b063d44..245bbd1d39 100644
--- a/src/Umbraco.Core/Models/PublishedContent/NoopPublishedValueFallback.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/NoopPublishedValueFallback.cs
@@ -37,16 +37,18 @@
}
///
- public bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, object defaultValue, out object value)
+ public bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, object defaultValue, out object value, out IPublishedProperty noValueProperty)
{
value = default;
+ noValueProperty = default;
return false;
}
///
- public bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, T defaultValue, out T value)
+ public bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, T defaultValue, out T value, out IPublishedProperty noValueProperty)
{
value = default;
+ noValueProperty = default;
return false;
}
}
diff --git a/src/Umbraco.Web/Models/PublishedContent/PublishedValueFallback.cs b/src/Umbraco.Web/Models/PublishedContent/PublishedValueFallback.cs
index 691744d6df..2890591ef1 100644
--- a/src/Umbraco.Web/Models/PublishedContent/PublishedValueFallback.cs
+++ b/src/Umbraco.Web/Models/PublishedContent/PublishedValueFallback.cs
@@ -45,7 +45,7 @@ namespace Umbraco.Web.Models.PublishedContent
value = defaultValue;
return true;
case Fallback.Language:
- if (TryGetValueWithLanguageFallback(property, culture, segment, defaultValue, out value))
+ if (TryGetValueWithLanguageFallback(property, culture, segment, out value))
return true;
break;
default:
@@ -53,7 +53,7 @@ namespace Umbraco.Web.Models.PublishedContent
}
}
- value = defaultValue;
+ value = default;
return false;
}
@@ -72,6 +72,7 @@ namespace Umbraco.Web.Models.PublishedContent
value = default;
return false;
}
+
_variationContextAccessor.ContextualizeVariation(propertyType.Variations, ref culture, ref segment);
foreach (var f in fallback)
@@ -84,7 +85,7 @@ namespace Umbraco.Web.Models.PublishedContent
value = defaultValue;
return true;
case Fallback.Language:
- if (TryGetValueWithLanguageFallback(content, alias, culture, segment, defaultValue, out value))
+ if (TryGetValueWithLanguageFallback(content, alias, culture, segment, out value))
return true;
break;
default:
@@ -92,33 +93,32 @@ namespace Umbraco.Web.Models.PublishedContent
}
}
- value = defaultValue;
+ value = default;
return false;
}
///
- public bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, object defaultValue, out object value)
+ public bool TryGetValue(IPublishedContent content, string alias, string culture, string segment, Fallback fallback, object defaultValue, out object value, out IPublishedProperty noValueProperty)
{
- // is that ok?
- return TryGetValue