1
Vote

Random NEs from DefaultContentManager when creating forums or threads

description

I don't have an exact repro yet, but this is something that only happens with Forums content types.

Sometimes when I create forums or threads (haven't seen it with posts yet) I get the following NE:

System.NullReferenceException occurred
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=Orchard.Framework
StackTrace:
at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options, QueryHints hints) in d:\Users\Zoltán\Projects\Munka\Lombiq\Lombiq\src\Orchard\ContentManagement\DefaultContentManager.cs:line 207
InnerException:

Call stack:
Orchard.Framework.dll!Orchard.ContentManagement.DefaultContentManager.Get(int id, Orchard.ContentManagement.VersionOptions options, Orchard.ContentManagement.QueryHints hints) Line 207 + 0x5e bytes   C#
Orchard.Framework.dll!Orchard.ContentManagement.DefaultContentManager.Get(int id, Orchard.ContentManagement.VersionOptions options) Line 119 + 0x47 bytes   C#
Orchard.Framework.dll!Orchard.ContentManagement.DefaultContentQuery.Slice.AnonymousMethod__2(Orchard.ContentManagement.Records.ContentItemVersionRecord x) Line 164 + 0x102 bytes   C#
[External Code] 
Orchard.Framework.dll!Orchard.Utility.Extensions.ReadOnlyCollectionExtensions.ToReadOnlyCollection<Orchard.ContentManagement.ContentItem>(System.Collections.Generic.IEnumerable<Orchard.ContentManagement.ContentItem> enumerable) Line 8 + 0x49 bytes C#
Orchard.Framework.dll!Orchard.ContentManagement.DefaultContentQuery.Slice(int skip, int count) Line 162 + 0xb2 bytes    C#
Orchard.Framework.dll!Orchard.ContentManagement.DefaultContentQuery.ContentQuery<NGM.Forum.Models.ThreadPart>.Orchard.ContentManagement.IContentQuery<T>.List() Line 212 + 0x25 bytes   C#
NGM.Forum.dll!NGM.Forum.Services.ThreadService.Get(int id, Orchard.ContentManagement.VersionOptions versionOptions) Line 31 + 0x263 bytes   C#
NGM.Forum.dll!NGM.Forum.Controllers.ThreadController.Item(int forumId, int threadId, Orchard.UI.Navigation.PagerParameters pagerParameters) Line 118 + 0x75 bytes C#
[External Code] 

Issue is that in DefaultContentManager ln 207 versionRecord.ContentItemRecord.ContentType is null, don't know why. I've seen this before when I changed the IContentManager interface from a failing unit test in Orchard core. Seb rolled out a fix but then reverted it as it has broken something else...

comments

Jetski5822 wrote Jul 1, 2013 at 11:05 PM

Ive seen this issue too, and its not localized to Forums. I will investigate further.

Piedone wrote Jul 10, 2013 at 2:05 PM

Thank you!