使用 Reflector 我检查了在哪里使用scEditorWarningTitle
(scEditorWarningTitle 是警告消息的标题类)。我发现它在 Sitecore.Client.dll 中,特别是在Sitecore.Shell.Applications.ContentMnaager.Editor.RenderWarning
. 该命名空间也有一个GetWarnings
方法,它关闭了getContentEditorWarnings
管道:
using (new LongRunningOperationWatcher(Settings.Profiling.RenderFieldThreshold, "GetContentEditorWarningsArgs pipeline", new string[0]))
{
CorePipeline.Run("getContentEditorWarnings", args);
}
查看该管道,我们可以看到它执行以下操作(默认情况下,至少在 Sitecore 6.5 更新 5 中 - 这在其他版本的 Sitecore 中可能有所不同):
<getContentEditorWarnings>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.ItemNotFound, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.CanReadLanguage, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.HasNoVersions, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.CanWrite, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.CanWriteWorkflow, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.CanWriteLanguage, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.IsReadOnly, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.IsLocked, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.HasNoFields, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.NeverPublish, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.ItemPublishingRestricted, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.VersionPublishingRestricted, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.ShowingInputBoxes, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.FeedIsEmpty, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.RunRules, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.Notifications, Sitecore.Kernel"/>
</getContentEditorWarnings>
同样在 Sitecore 6.5 update 5 中,我看到的唯一VersionPublishingRestricted
警告是:
如果您现在发布,所选版本将不会在网站上可见,因为它不在最后的工作流程步骤中
如果您现在发布,所选版本将不会在网站上可见,因为今天不在其有效日期内range
如果您现在发布,所选版本将在网站上不可见,因为它已被更新的版本替换
如果您现在发布,所选版本将在网站上不可见
有可能描述任何一个
将改为发布版本 X
或者
不会发布其他版本
我检查过的所有其他在管道中的处理器也没有提到被旧版本取代。
如果较旧的不是拼写错误,则值得查看getContentEditorWarnings
管道或检查您的规则(位于/sitecore/system/Settings/Rules/Content Editor Warnings/Rules
)
编辑
正确,正如@horseman 所说,在 Sitecore 6.6 中,它位于VersionPublishingRestrictions
:
if ((validVersion != null) && (item.Version.Number < validVersion.Version.Number))
{
warning.Title = Translate.Text("If you publish now, the selected version will not be visible on the Web site because it has been replaced by a newer version.");
}
else if ((validVersion != null) && (item.Version.Number > validVersion.Version.Number))
{
warning.Title = Translate.Text("If you publish now, the selected version will not be visible on the Web site because it has been replaced by an older version.");
}
else if (IsInWorkflow(item))
{
warning.Title = Translate.Text("If you publish now, the selected version will not be visible on the Web site because it is not in the final workflow step.");
}
else if ((item.Publishing.ValidFrom > now) || (item.Publishing.ValidTo <= now))
{
warning.Title = Translate.Text("If you publish now, the selected version will not be visible on the Web site because today does not fall within its valid date range.");
}
else
{
warning.Title = Translate.Text("If you publish now, the selected version will not be visible on the Web site.");
}
因此,如果存在有效版本,并且有效版本号小于当前所选项目的版本号,您将收到以下消息:
If you publish now, the selected version will not be visible on the Web site because it has been replaced by an older version.