U4-11227 - default variations and fallback (wip)

This commit is contained in:
Stephan
2018-04-18 19:46:47 +02:00
parent 8873fa9dd4
commit 908589277a
52 changed files with 590 additions and 228 deletions

View File

@@ -18,6 +18,11 @@ namespace Umbraco.Core.Models.PublishedContent
if (content == null)
return null;
// in order to provide a nice, "fluent" experience, this extension method
// needs to access Current, which is not always initialized in tests - not
// very elegant, but works
if (!Current.HasContainer) return content;
// get model
// if factory returns nothing, throw
var model = Current.PublishedModelFactory.CreateModel(content);