V8: Allow nested content without blueprints (#4777)
* Don't assume there is at least one NC blueprint * NC disabled icon styling (hover pointer type) * Allow and handle NC configs without blueprints
This commit is contained in:
committed by
Niels Lyngsø
parent
aba409600b
commit
67e046e477
@@ -35,9 +35,9 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
public override Type GetPropertyValueType(PublishedPropertyType propertyType)
|
||||
{
|
||||
var contentTypes = propertyType.DataType.ConfigurationAs<NestedContentConfiguration>().ContentTypes;
|
||||
return contentTypes.Length > 1
|
||||
? typeof (IEnumerable<IPublishedElement>)
|
||||
: typeof (IEnumerable<>).MakeGenericType(ModelType.For(contentTypes[0].Alias));
|
||||
return contentTypes.Length == 1
|
||||
? typeof (IEnumerable<>).MakeGenericType(ModelType.For(contentTypes[0].Alias))
|
||||
: typeof (IEnumerable<IPublishedElement>);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -57,9 +57,9 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
{
|
||||
var configuration = propertyType.DataType.ConfigurationAs<NestedContentConfiguration>();
|
||||
var contentTypes = configuration.ContentTypes;
|
||||
var elements = contentTypes.Length > 1
|
||||
? new List<IPublishedElement>()
|
||||
: PublishedModelFactory.CreateModelList(contentTypes[0].Alias);
|
||||
var elements = contentTypes.Length == 1
|
||||
? PublishedModelFactory.CreateModelList(contentTypes[0].Alias)
|
||||
: new List<IPublishedElement>();
|
||||
|
||||
var value = (string)inter;
|
||||
if (string.IsNullOrWhiteSpace(value)) return elements;
|
||||
|
||||
Reference in New Issue
Block a user