Orchardcms Orchard CMS 1.4.2:自动路由错误和其他错误

Orchardcms Orchard CMS 1.4.2:自动路由错误和其他错误,orchardcms,Orchardcms,我有一个新的Orchard CMS 1.4.2安装,我添加了一个自定义模块 自定义模块有3个自定义部件,它们基本上是bodypart ContentPart的副本 我对bodypart(或Orchard…)了解不多,我注意到mycustompartrecord类源自: ContentPartVersionRecord 一个问题是我不知道为什么 另一个问题是,运行该站点时,在更新其中一个自定义“bodypart”内容部分的文本后,我会出现以下错误 2012-06-02 08:15:49,580

我有一个新的Orchard CMS 1.4.2安装,我添加了一个自定义模块

自定义模块有3个自定义部件,它们基本上是bodypart ContentPart的副本

我对bodypart(或Orchard…)了解不多,我注意到mycustompartrecord类源自:

ContentPartVersionRecord
一个问题是我不知道为什么

另一个问题是,运行该站点时,在更新其中一个自定义“bodypart”内容部分的文本后,我会出现以下错误

2012-06-02 08:15:49,580 [21] Orchard.ContentManagement.DefaultContentManager - ArgumentOutOfRangeException thrown from IContentHandler by Orchard.Autoroute.Handlers.AutoroutePartHandler
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at System.Linq.Enumerable.ElementAt[TSource](IEnumerable`1 source, Int32 index)
   at Orchard.Autoroute.Services.AutorouteService.GetDefaultPattern(String contentType)
   at Orchard.Autoroute.Services.AutorouteService.GenerateAlias(AutoroutePart part)
   at Orchard.Autoroute.Handlers.AutoroutePartHandler.PublishAlias(AutoroutePart part)
   at Orchard.Autoroute.Handlers.AutoroutePartHandler.<.ctor>b__2(PublishContentContext ctx, AutoroutePart part)
   at Orchard.ContentManagement.Handlers.ContentHandler.InlineStorageFilter`1.Published(PublishContentContext context, TPart instance) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 156
   at Orchard.ContentManagement.Handlers.StorageFilterBase`1.Orchard.ContentManagement.Handlers.IContentStorageFilter.Published(PublishContentContext context) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\ContentManagement\Handlers\StorageFilterBase.cs:line 81
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.Published(PublishContentContext context) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 274
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass3d.<Publish>b__3b(IContentHandler handler) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 342
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\InvokeExtensions.cs:line 19

该错误在日志中只出现过一次,此后似乎不会影响系统。不知道这是否与自动路由部分错误有关。

很遗憾,我无法回答您的主要问题

至于ContentPartVersionRecord:当您需要对一个部件进行版本控制时(即每次修改都保存一个新的内容副本),您需要使用这个。BodyPart是版本化内容部件的一种情况

2012-06-02 08:15:49,580 [21] Orchard.ContentManagement.DefaultContentManager - ArgumentOutOfRangeException thrown from IContentHandler by Orchard.Autoroute.Handlers.AutoroutePartHandler
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at System.Linq.Enumerable.ElementAt[TSource](IEnumerable`1 source, Int32 index)
   at Orchard.Autoroute.Services.AutorouteService.GetDefaultPattern(String contentType)
   at Orchard.Autoroute.Services.AutorouteService.GenerateAlias(AutoroutePart part)
   at Orchard.Autoroute.Handlers.AutoroutePartHandler.PublishAlias(AutoroutePart part)
   at Orchard.Autoroute.Handlers.AutoroutePartHandler.<.ctor>b__2(PublishContentContext ctx, AutoroutePart part)
   at Orchard.ContentManagement.Handlers.ContentHandler.InlineStorageFilter`1.Published(PublishContentContext context, TPart instance) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 156
   at Orchard.ContentManagement.Handlers.StorageFilterBase`1.Orchard.ContentManagement.Handlers.IContentStorageFilter.Published(PublishContentContext context) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\ContentManagement\Handlers\StorageFilterBase.cs:line 81
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.Published(PublishContentContext context) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 274
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass3d.<Publish>b__3b(IContentHandler handler) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 342
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in C:\Users\Andrew\Documents\Dox\Webs\Orchard\src\Orchard\InvokeExtensions.cs:line 19

我认为您得到的SQL异常是完全无害的,正如安装程序所期望的那样。此查询用于检查数据库是否已设置-如果设置失败,则不会设置。

谢谢,希望我能提供一些帮助。