OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

NullReferenceException after add custom displayType-- FeatureSummary #4798

Open orchardbot opened 9 years ago

orchardbot commented 9 years ago

infofromca created: https://orchard.codeplex.com/workitem/20969

public class HouseHandler : ContentHandler { public HouseHandler( ) { OnActivated((context, part) => {
var _contentManager = context.ContentItem.ContentManager;
_contentManager.BuildDisplay(part, "FeatureSummary"); }); }

}

in my HousePartDrive , i deal with "FeatureSummary" ---no error. but all the other parts within the contenttype got the following errors i my log. but everything is ok for edit ,display for the contenttype 2014-09-27 00:40:34,188 [45] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - (null) - NullReferenceException thrown from IContentPartDriver by Orchard.Core.Title.Drivers.TitlePartDriver (null) System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.Themes.CurrentThemeWorkContext.Get[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Themes\CurrentThemeWorkContext.cs:line 21 at Orchard.Environment.WorkContextImplementation.<>cDisplayClass71.b2(IWorkContextStateProvider wcsp) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 32 at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Orchard.Environment.WorkContextImplementation.FindResolverForState[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 32 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Orchard.Environment.WorkContextImplementation.GetState[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 27 at Orchard.WorkContext.get_CurrentTheme() in g:\orchard1x419-zg\orchard\src\Orchard\WorkContext.cs:line 66 at Orchard.ContentManagement.DefaultContentDisplay.<>cDisplayClass1c.b1b(String partShapeType, String differentiator, String defaultLocation) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\DefaultContentDisplay.cs:line 123 at Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 29 at Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildDisplayContext context) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 21 at Orchard.ContentManagement.Drivers.CombinedResult.Apply(BuildDisplayContext context) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\CombinedResult.cs:line 28 at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>cDisplayClassa.b9(IContentPartDriver driver) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 49 at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable1 events, Action1 dispatch, ILogger logger) in g:\orchard1x419-zg\orchard\src\Orchard\InvokeExtensions.cs:line 17 2014-09-27 00:40:37,483 [45] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - (null) - NullReferenceException thrown from IContentPartDriver by Orchard.Core.Common.Drivers.BodyPartDriver (null) System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.Themes.CurrentThemeWorkContext.Get[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Themes\CurrentThemeWorkContext.cs:line 21 at Orchard.Environment.WorkContextImplementation.<>cDisplayClass71.b2(IWorkContextStateProvider wcsp) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 32 at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Orchard.Environment.WorkContextImplementation.FindResolverForState[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 32 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Orchard.Environment.WorkContextImplementation.GetState[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 27 at Orchard.WorkContext.get_CurrentTheme() in g:\orchard1x419-zg\orchard\src\Orchard\WorkContext.cs:line 66 at Orchard.ContentManagement.DefaultContentDisplay.<>cDisplayClass1c.b1b(String partShapeType, String differentiator, String defaultLocation) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\DefaultContentDisplay.cs:line 123 at Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 29 at Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildDisplayContext context) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 21 at Orchard.ContentManagement.Drivers.CombinedResult.Apply(BuildDisplayContext context) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\CombinedResult.cs:line 28 at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>cDisplayClassa.b9(IContentPartDriver driver) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 49 at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable1 events, Action1 dispatch, ILogger logger) in g:\orchard1x419-zg\orchard\src\Orchard\InvokeExtensions.cs:line 17 2014-09-27 00:40:37,791 [45] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - (null) - NullReferenceException thrown from IContentPartDriver by Orchard.Core.Common.Drivers.CommonPartDriver (null) System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.Themes.CurrentThemeWorkContext.Get[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Themes\CurrentThemeWorkContext.cs:line 21 at Orchard.Environment.WorkContextImplementation.<>cDisplayClass71.b2(IWorkContextStateProvider wcsp) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 32 at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Orchard.Environment.WorkContextImplementation.FindResolverForState[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 32 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Orchard.Environment.WorkContextImplementation.GetState[T](String name) in g:\orchard1x419-zg\orchard\src\Orchard\Environment\WorkContextImplementation.cs:line 27 at Orchard.WorkContext.get_CurrentTheme() in g:\orchard1x419-zg\orchard\src\Orchard\WorkContext.cs:line 66 at Orchard.ContentManagement.DefaultContentDisplay.<>cDisplayClass1c.b1b(String partShapeType, String differentiator, String defaultLocation) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\DefaultContentDisplay.cs:line 123 at Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 29 at Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildDisplayContext context) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 21 at Orchard.ContentManagement.Drivers.CombinedResult.Apply(BuildDisplayContext context) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\CombinedResult.cs:line 28 at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>cDisplayClassa.b9(IContentPartDriver driver) in g:\orchard1x419-zg\orchard\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 49 at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable1 events, Action1 dispatch, ILogger logger) in g:\orchard1x419-zg\orchard\src\Orchard\InvokeExtensions.cs:line 17

orchardbot commented 9 years ago

infofromca commented:

see log

orchardbot commented 9 years ago

infofromca commented:

use latest 1.x, it is good now.pls close it