Tridion 2011 SP1:安装了Translation Manager和Powertools 2011的Trid

Tridion 2011 SP1 : Tridion GUI Javascript error with Translation Manager and Powertools 2011 installed

本文关键字:2011 Powertools Trid Manager SP1 安装 Tridion Translation      更新时间:2023-09-26

我最近安装了Tridion 2011 SP1,并启用了SDL模块Translation Manager。

一切都很好。然后我按照安装程序安装了Tridion 2011 Powertools。

当尝试重新加载GUI时(浏览器缓存被清空,WebRoot''Configuration''System.Config中服务器元素的修改参数被设置),我得到了以下Javascript错误:

SCRIPT5007:无法获取属性"getItemType"的值:对象为null或未定义
Dashboard_v6.1.0.55920.18_.aspx?mode=js,第528行字符851

这里是相关的JS行:

Tridion.TranslationManager.Commands.Save.protype.isAvailable=函数(c,a){var
e=c.getItem(0),f=$models.getItem(e),b=f.getItemType(),d=$models.getItem(this.getTmUri())

前面的Javascript行处理其他TranslationManager命令,所以我认为这是一种TranslationManager的命令注册或其他处理。

尝试通过选择任何文件夹/结构浏览我的Tridion出版物也会出现同样的错误,右侧框架(内容框架)不会显示任何Tridion项目,而只是显示:

正在加载。。。

有人经历过类似的问题吗?

现在我别无选择,只能评论掉Powertools部分文件

Tridion_Home''web''WebUI''WebRoot''Configuration''System.Config

谢谢,François

奇怪的是,它引用了Save命令,而该命令不打算从Dashboard调用或使用。

我建议禁用JS缩小(System.config中的JScriptMinifier筛选器),因为它可能会显示更正确的详细信息。

另一个有用的东西是这个错误调用堆栈。

--

我无法从最初的问题中重现问题,但在安装PT时出现了以下错误:

PowerTools未定义

出现在*''PowerTools''Editor''PowerTools''Client''Shared''Scripts''ProgressDialog''ProgressDialog.js,它尝试在其中注册PowerToolsBase命名空间,而不是PowerTools

如果添加,我会感到惊讶

类型.registerNamespace("PowerTools");

在文件的顶部将修复一个问题,就像在我的情况下,无论是否包含TM,它都会破坏整个GUI。

我确实检查了**PowerTools''Editor''PowerTools''Client''Shared''Scripts''ProgressDialog''ProgressDialog.js,但行

类型.registerNamespace("PowerTools");

已经在那里了,所以这里没有问题。

此外,我禁用了JS缩小。以下是UI在收到错误之前加载的主要方法:

...
PowerTools.Commands.ItemCommenting.prototype.isValidSelection = function (selection) {
//Use the existing Save command from the CME
return $cme.getCommand("Save")._isEnabled(selection);
}
...
/**
* Executes this command on the selection.
* Override this method to implement the actual functionality.
* @param {Tridion.Core.Selection} selection The current selection.
*/
Tridion.TranslationManager.Commands.SendForTranslation.prototype._execute = function SendForTranslation$_execute(selection)
{
    var selectedItems = selection.getItems();
    if (selectedItems.length == 1)
    {
        var job = $models.getItem(selectedItems[0]);
        if (job)
        {
            if (job.isLoaded())
            {
                job.saveAndSend();
            }
            else
            {
                $log.warn("Unable to send an unloaded job?! {0}".format(job.getId()));
            }
        }
        else
        {
            $log.warn("Unable to execute save-and-send-for-translation for this selection: {0}".format(selectedItems));
        }
    }
    else
    {
        $log.warn("Unable to save-and-send-for-translation multiple items at a time.");
    }
};
...
Tridion.TranslationManager.Commands.Save.prototype._isAvailable = function Save$_isAvailable(selection, pipeline)
{
    var itemUri = selection.getItem(0);
    var item = $models.getItem(itemUri);
    var itemType = item.getItemType();     !!!!!!!!! fails on this line !!!!!! item is null or not an object
    var config = $models.getItem(this.getTmUri());

    if (pipeline)
    {
        pipeline.stop = false;
    }
    if (config && config.hasChanged() && (itemType == $const.ItemType.CATEGORY || itemType == $const.ItemType.FOLDER || itemType == $const.ItemType.STRUCTURE_GROUP || itemType == $const.ItemType.PUBLICATION))
    {
        if (pipeline)
        {
            pipeline.stop = true;
        }
        return true;
    }
    return this.callBase("Tridion.Cme.Command", "_isAvailable", [selection, pipeline]);
};

好的。现在很清楚了。

PowerTools.Commands.ItemCommenting用于仪表板工具栏。此命令使用Save检查其可用性。

与此同时,TM认为"保存"只会在ItemToolbar上使用。

导致问题的这些工具栏之间的区别在于,当"项目"视图总是有一个项目(当前打开)的选择时,"面板"视图可以有任何长度的选择。

ItemCommenting试图通过调用Save来检查其可用性,Save调用其所有扩展。到目前为止,选择是空的

var itemUri=选择.getItem(0);

将返回null以及

$models.getItem(null)

您可以做的是删除ItemCommenting扩展命令,就像在triion powertool trunk editor.config中所做的那样。

http://code.google.com/p/tridion-2011-power-tools/source/browse/trunk/PowerTools.Editor/Configuration/editor.config?spec=svn942&r=903[592]