你好.我在Sitecore 8 Analytics中遇到的问题 - 它的错误'位置0没有行',当我在'EXPERIANCE PROFILE'中查看非常用户的标签'PROFILE'和'OVERVIEW'时.
Sitecore 8的更新中也存在此错误.导致此错误的原因是什么?
我试图看到某个项目的链接项目.我在客户端的内容管理服务器上执行此操作.当我点击导航 - >链接时,没有任何反应.我在JavaScript控制台中收到此错误:
http://sitename.local/sitecore/shell/default.aspx?xmlcontrol = Gallery.Links& ... de-DE&vs = 1&db = master&sc_content = master&ShowEditor = 1&Ribbon.RenderTabs = true
无法加载资源:服务器响应状态为500(内部服务器错误)
这是我在Sitecore日志中看到的内容:
38424 19:09:30 ERROR Application error.
Exception: System.Web.HttpUnhandledException
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Nested Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle.InvokeMethod(Object …
Run Code Online (Sandbox Code Playgroud) 我最近将Sitecore从6.6版本升级到8.0版本-4.并开始升级WFFM模块,但我得到了一些与分析相关的错误.因此我计划在Sitecore中安装新的WFFM 8.0模块,同时安装它会抛出错误"无法识别的Guid格式".我已经尝试删除web.config文件中的ItemNameValidation设置.但仍然不适合我.
任何帮助,将不胜感激!!
谢谢,Yogesh
我曾经使用通配符实现列表/详细信息场景,这意味着,为了URL,我创建一个常规项来显示列表,然后在该节点下,我创建一个通配符项来表示所有可能的详细信息页面,如:
/news/*
Run Code Online (Sandbox Code Playgroud)
(我通过代码生成一个友好的名称来替换通配符并生成完整的URL,例如:mywebsite.com/news/the-meeting-press-release)
然后我在其他地方创建一个文件夹或一桶内容项作为我的存储库.然后我将相同的数据源分配给列表节点和通配符节点,以便为它们提供相同的内容项存储库.
我想要这样做的主要原因是使用数据源并使导航节点(生成实际页面和URL)与内容文件夹结构分开.换句话说,关注点分离:导航项目作为表示节点,内容项目作为我的数据存储库.
这是解决主/细节要求的简单方法,但我总是对此感到内疚,感觉这种技术打破了Sitecore后端的完整性(sitecore链接数据库表)和设计模式.
例如,当我查看分析时,我得到*作为项目的名称,显然它感觉像后端系统的外星人.
我知道这不是一个新话题.我已经看到像这样的线程或像Sitecore Pipeline Processor for Virtual Items这样的想法来实现这样的要求.
这有什么最好的做法吗?有什么最好的sitecore友好的方式实现这样的管道处理器的好例子?您如何使用Google Analytics上的通配符来解决此问题?
我正在使用玻璃映射器中的GetDataSourceItem方法将我的数据源项返回到视图,当数据源为空时,我调试了代码,控制器中的calloutModel将为null,但是从视图中,模型将不为null,它将具有当前项目模型,我正在使用以下代码:
我的控制器动作:
public ActionResult Callout()
{
// I didn't fill the datasource in the component
// calloutModel value is coming null.
var calloutModel= GetDataSourceItem<CalloutModel>();
return View(calloutModel);
}
Run Code Online (Sandbox Code Playgroud)
我的看法:
@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<CalloutModel>
// Model is coming the current item in the view (it should be null)
Run Code Online (Sandbox Code Playgroud) 我们将我们的解决方案从Sitecore 8.1 Update 1升级到Update 2.我们的URL是根据显示名称生成的,并且运行正常.
但升级后,行为更改为从项目名称生成URL,尽管ShowConfig.aspx仍显示"useDisplayName ="true"for.
我们使用以下配置:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<linkManager defaultProvider="sitecore">
<providers>
<clear/>
<add name="sitecore">
<patch:attribute name="addAspxExtension">false</patch:attribute>
<patch:attribute name="useDisplayName">true</patch:attribute>
<patch:attribute name="languageEmbedding">never</patch:attribute>
<patch:attribute name="alwaysIncludeServerUrl">true</patch:attribute>
</add>
</providers>
</linkManager>
</sitecore>
Run Code Online (Sandbox Code Playgroud)
现在所有链接只显示404.我错过了什么?
我们尝试了一个空的解决方案,这是相同的行为.所以这是一个Sitecore错误.
a中的某些项目MultiListField
必须以html格式显示,但在2列中显示为:
Item1 Item2
Item3 Item4
<div id="menu-section" runat="server">
<div class="clearfix">
<div class="col-xs-6">
<p>Item1 Name</p>
</div>
<div class="col-xs-6">
<p>Item2 Name</p>
</div>
</div>
<div class="clearfix">
<div class="col-xs-6">
<p>Item3 Name</p>
</div>
<div class="col-xs-6">
<p>Item4 Name</p>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
内容作者应该能够从体验编辑器编辑每个项目.
如果它是一个列,我将使用asp:Repeater
和sc:
控制完成此操作.
所以,相反,我在字符串上构建了html并在页面上呈现.
C#
StringBuilder sb = new StringBuilder();
sb.Append("<div class=\"clearfix\">");
.
.
..
menu-section.innerHtml = sb.ToString();
Run Code Online (Sandbox Code Playgroud)
虽然,项目是按需要呈现的,但我不知道如何使它们可编辑.
包络menu-section
内sc:EditFrame
将只允许添加/删除/项目的排序,但不能编辑每个项目.
有什么想法,怎么做?
我在尝试使用Sitecore 8.2的Autofac DI时收到以下错误:
依赖项解析程序的类型为"Sitecore.Mvc.Controllers.SitecoreDependencyResolver",但预计类型为"Autofac.Integration.Mvc.AutofacDependencyResolver".它似乎也没有使用Castle Project中的DynamicProxy进行包装.此问题可能是DynamicProxy实现更改或使用其他代理库来包装依赖项解析程序的结果.
任何想法:
在我的web.config中,我定义了一些自定义log4net错误记录器:
<configuration>
<log4net>
<appender name="RR.Db" type="log4net.Appender.SitecoreLogFileAppender, Sitecore.Logging">
<file value="$(dataFolder)/logs/RR.Db.{date}.txt" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%4t %d{ABSOLUTE} %-5p %m%n" />
</layout>
<encoding value="utf-8" />
</appender>
<logger name="RR.Db" additivity="false">
<level value="INFO"/>
<appender-ref ref="RR.Db"/>
</logger>
....
</log4net>
</configuration>
Run Code Online (Sandbox Code Playgroud)
这些一直都很好.当我将sitecore从8.0升级到8.1(以及随后的8.2)时,我的所有记录器突然停止工作.发送到自定义日志的所有日志刚刚开始出现在默认的log.log文件中,并且没有创建任何自定义日志.
为什么?我怎样才能解决这个问题?
我是一名 Sitecore 开发人员,我想在单元测试中使用 Sitecore.FakeDb。我有以下代码:
[TestClass]
public class UnitTest1
{
[TestMethod]
public void Test_ArticleController_With_SitecoreItem()
{
Sitecore.Data.ID about_us_itemId = Sitecore.Data.ID.NewID;
Sitecore.Data.ID careers_itemId = Sitecore.Data.ID.NewID;
using (var db = new Sitecore.FakeDb.Db
{
new Sitecore.FakeDb.DbItem("about-us", about_us_itemId)
{
new Sitecore.FakeDb.DbField(SitecoreFieldIds.WTW_REDIRECT_TO) { Value = "/WTW-Home/about-us/overview" }
},
new Sitecore.FakeDb.DbItem("careers", careers_itemId)
{
new Sitecore.FakeDb.DbField(SitecoreFieldIds.WTW_REDIRECT_TO) { Value = "http://careers.willistowerswatson.com" }
}
})
{
Sitecore.Data.Items.Item sampleItem3 = db.GetItem(about_us_itemId); // throws error
Sitecore.Data.Items.Item sampleItem2 = db.GetItem("/sitecore/content/careers"); //throws error
//Assert
Assert.AreEqual("abc", "abc");
};
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试上述两行 .GetItem(...) 行时,出现以下错误:
System.TypeInitializationException: 'The type …
Run Code Online (Sandbox Code Playgroud) sitecore8 ×10
sitecore ×9
c# ×2
glass-mapper ×2
asp.net ×1
autofac ×1
log4net ×1
logging ×1
mongodb ×1
moq ×1
sitecore-mvc ×1
sitecore8.1 ×1
sitecore8.2 ×1