【问题标题】:Sitecore 8 (revision 150121), Analytics (MongoDB), Error "There is no row at position 0."Sitecore 8(修订版 150121)、Analytics (MongoDB)、错误“位置 0 处没有行”。
【发布时间】:2015-02-28 15:23:47
【问题描述】:

你好。我在 Sitecore 8 Analytics 中的问题 - 当我在“体验配置文件”中查看非匿名用户的“个人资料”和“概述”选项卡时,出现错误“第 0 位没有行。”。

在 Sitecore 8 的更新中也存在此错误。是什么导致了此错误?。

【问题讨论】:

  • 请问您能澄清您的问题吗?似乎您可能指的是体验配置文件而不是用户配置文件,但目前还不清楚。另外,您可以发布整个错误堆栈跟踪或屏幕截图吗?

标签: c# mongodb sitecore sitecore8 sitecore-analytics


【解决方案1】:

所以,这个问题是 Sitecore 开发者的错误调用的。

分析了“FindBestPatternMatchAndApplyToProfileInfo”类的代码及其方法后,我可以从元素中找到空数组(“dataTable”对象中的属性“Rows”) .这导致超出范围异常。


这个问题可以通过实现您自己的类(FindBestPatternMatchAndApplyToProfileInfo 的副本)并添加 "if"-statement 来检查“Rows”字段来解决:

private bool ApplyPatternToOneProfile(ReportProcessorArgs args, DataRow profileRow)
    {
        bool flag = true;
        if (DataRowExtensions.Field<Guid>(profileRow, Sitecore.Cintel.Reporting.Contact.ProfileInfo.Schema.ProfileId.Name) == Guid.Empty)
            flag = false;
        ViewParameters retrievingBestPattern = CustomProcessorViewPatternProfile.GetParametersForRetrievingBestPattern(args, profileRow);
        DataTable dataTable = CustomerIntelligenceManager.ViewProvider.GenerateContactView(retrievingBestPattern).Data.Dataset[retrievingBestPattern.ViewName];
        if (dataTable.Rows != null && dataTable.Rows.Count != 0)
        {
            if (!this.TryFillData<Guid>(profileRow, Sitecore.Cintel.Reporting.Contact.ProfileInfo.Schema.BestMatchedPatternId, dataTable.Rows[0], Sitecore.Cintel.Reporting.Contact.ProfilePatternMatch.Schema.PatternId.Name) || !this.TryFillData<string>(profileRow, Sitecore.Cintel.Reporting.Contact.ProfileInfo.Schema.BestMatchedPatternDisplayName, dataTable.Rows[0], Sitecore.Cintel.Reporting.Contact.ProfilePatternMatch.Schema.PatternDisplayName.Name) || !this.TryFillData<double>(profileRow, Sitecore.Cintel.Reporting.Contact.ProfileInfo.Schema.BestMatchedPatternGravityShare, dataTable.Rows[0], Sitecore.Cintel.Reporting.Contact.ProfilePatternMatch.Schema.PatternGravityShare.Name))
                flag = false;
        }
        else
        {
            flag = false;
        }

        return flag;
    } 

更新:

或者,您可以通过在 Sitecore 营销控制面板 中为相应的配置文件添加至少一个模式卡来解决此问题。(https://developers.coveo.com/display/public/SC201503/Understanding+Profiles+and+Pattern+Cards;jsessionid=D03AC5B4F9F4B4E588538BC977BE2F6D)

【讨论】:

    猜你喜欢
    • 2015-09-07
    • 2019-06-03
    • 1970-01-01
    • 1970-01-01
    • 2011-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多