【问题标题】:Exception of Glassmapper after upgrading to Sitecore 8.2升级到 Sitecore 8.2 后 Glassmapper 的异常
【发布时间】:2023-04-02 14:07:02
【问题描述】:

在我们升级到 Sitecore 8.2 和 glass mapper 版本 4.3.4.197 后,我遇到了以下异常。

异常:消息 =“找不到父项的配置 键入 Sitecore.Data.Items.Item"

我的代码如下:

将项目保存到主数据库

Parent Item type = Sitecore.Data.Items
var newItem = sitecoreContext.Create(parentItem , fixed);  

【问题讨论】:

    标签: sitecore sitecore8.2


    【解决方案1】:

    我遇到了同样的问题,发现如果您将父项转换为特定模板,它似乎可以工作。例如,而不是

    Item parent = sitecoreService.GetItem<Item>(GUID); ChildTemplateType childItem = sitecoreService.Create(parent, childData);

    使用:

    Item parent = sitecoreService.GetItem<Item>(GUID); ParentTemplateType parentCasted = sitecoreService.Cast<ParentTemplateType>(parent); ChildTemplateType childItem = sitecoreService.Create(parentCasted, childData);

    【讨论】:

      猜你喜欢
      • 2017-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-23
      相关资源
      最近更新 更多