我有一个新的 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
我真的不知道这是什么原因。在添加内容时,它似乎没有负面影响。我怀疑这与我使用这些正文部分副本的方式有关,但我不确定。
笔记:
正如在上一个线程中所讨论的(请参阅此处的详细信息),我之前在使用 Orchard v.1.4.2 的 CLEAN 源代码安装(即,没有模块,没有自定义)时遇到了另一个错误。错误如下:
在安装任何模块并进行全新安装之前,我收到以下错误:
2012-05-31 17:59:43,876 [9] NHibernate.AdoNet.AbstractBatcher - Could not execute query: SELECT this_.Id as Id13_0_, this_.SerialNumber as SerialNu2_13_0_ FROM Settings_ShellDescriptorRecord this_ WHERE 1=1
System.Data.SqlServerCe.SqlCeException (0x80004005): The specified table does not exist. [ Settings_ShellDescriptorRecord ]
at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
2012-05-31 17:59:43,892 [9] NHibernate.Util.ADOExceptionReporter - The specified table does not exist. [ Settings_ShellDescriptorRecord ]
2012-05-31 17:59:43,907 [9] NHibernate.Util.ADOExceptionReporter - The specified table does not exist. [ Settings_ShellDescriptorRecord ]
该错误仅在日志中出现一次,此后似乎不会影响系统。不知道这是否与 autoroutepart 错误有关。