我有一个新的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
我真的不知道这是什么原因。添加内容似乎没有负面影响。我怀疑这与我使用这些身体部分副本的方式有关,但我不确定。
如前一个帖子(See details here)中所讨论的,当使用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错误有关。
答案 0 :(得分:1)
不幸的是我无法回答你的主要问题。
对于ContentPartVersionRecord:当您需要对部件进行版本控制时(即每次修改都保存其内容的新副本),您需要使用它。 BodyPart是版本化内容部分的案例。
你得到的SQL异常是我认为完全无害的,因为它在设置时是预期的。此查询用于检查数据库是否已设置 - 如果失败,则不然。