V8: Can't show list views for variant content on latest
See original GitHub issueThere’s something funky going on. I have a culture variant content type with list view enabled. On latest source (d0b9fb7d) this results in:
Removing the list view fixes the problem.
The error originates from the call to ContentController.GetChildren
(http://localhost:8100/umbraco/backoffice/UmbracoApi/Content/GetChildren?id=1093&includeProperties=updateDate,owner&pageNumber=1&pageSize=2&orderBy=updateDate&orderDirection=Descending&orderBySystemField=true&filter=&cultureName=en-US). The controller action itself executes just fine, but when AngularJsonMediaTypeFormatter
is tasked with writing the response, it throws the error shown above.
I’m pretty sure this error has been introduced within the last few days. That should narrow down the search for the bug 😄 I’d hunt for it myself but I’m at a loss as to why the ContentPropertyBasicMapper
is invoked while writing the response.
Full stack trace of the inner exception
System.InvalidOperationException: No culture found in mapping operation when one is required for the culture variant property type heading
at Umbraco.Web.Models.Mapping.ContentPropertyBasicMapper1.Map(Property property, TDestination dest, MapperContext context) in D:\Projects\Umbraco-CMS-V8\src\Umbraco.Web\Models\Mapping\ContentPropertyBasicMapper.cs:line 63 at Umbraco.Web.Models.Mapping.ContentPropertyMapDefinition.Map(Property source, ContentPropertyBasic target, MapperContext context) in D:\Projects\Umbraco-CMS-V8\src\Umbraco.Web\Models\Mapping\ContentPropertyMapDefinition.cs:line 46 at Umbraco.Core.Mapping.UmbracoMapper.<>c__DisplayClass8_0
2.<Define>b__1(Object source, Object target, MapperContext context) in D:\Projects\Umbraco-CMS-V8\src\Umbraco.Core\Mapping\UmbracoMapper.cs:line 83
at Umbraco.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, Type sourceType, MapperContext context) in D:\Projects\Umbraco-CMS-V8\src\Umbraco.Core\Mapping\UmbracoMapper.cs:line 187
at Umbraco.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, MapperContext context) in D:\Projects\Umbraco-CMS-V8\src\Umbraco.Core\Mapping\UmbracoMapper.cs:line 135
at Umbraco.Core.Mapping.UmbracoMapper.Map[TTarget](Object source) in D:\Projects\Umbraco-CMS-V8\src\Umbraco.Core\Mapping\UmbracoMapper.cs:line 111
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 677
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 179
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 469
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 173
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 703
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 179
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 469
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 173
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:line 95
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) in //Src/Newtonsoft.Json/JsonSerializer.cs:line 1149
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)
at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Umbraco.Web.WebApi.AngularJsonMediaTypeFormatter.<WriteToStreamAsync>d__1.MoveNext() in D:\Projects\Umbraco-CMS-V8\src\Umbraco.Web\WebApi\AngularJsonMediaTypeFormatter.cs:line 52
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.WebHost.HttpControllerHandler.<WriteBufferedResponseContentAsync>d__22.MoveNext()
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Have merged the PR but not entirely happy (see my note on the PR) about the context situation. It is way too error-prone.
So, re-opening the issue to try to find a better way.
Thanks for reporting (vlatest) has done a lot of changes with how things are mapped so there must be a regression issue there. Will get this looked at!