This project is read-only.

Random NEs from DefaultContentManager when creating forums or threads


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
Message=Object reference not set to an instance of an object.
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

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...


Jetski5822 wrote Jul 2, 2013 at 12:05 AM

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

Piedone wrote Jul 10, 2013 at 3:05 PM

Thank you!