【问题标题】:Tridion 2011 SP1 : Tridion GUI Javascript error with Translation Manager and Powertools 2011 installedTridion 2011 SP1:安装了翻译管理器和 Powertools 2011 的 Tridion GUI Javascript 错误
【发布时间】:2013-02-04 06:53:31
【问题描述】:

我最近安装了启用了 SDL 模块翻译管理器的 Tridion 2011 SP1。

一切正常。然后我按照安装程序安装了 Tridion 2011 Powertools。

当尝试重新加载 GUI 时(浏览器缓存已清空并为 WebRoot\Configuration\System.Config 中的服务器元素实例化了修改参数),我收到以下 Javascript 错误:

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

这里是相关的 JS 行:

Tridion.TranslationManager.Commands.Save.prototype._isAvailable=function(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

谢谢你, 弗朗索瓦

【问题讨论】:

  • PowerTools 真的适合您吗?如果您改为注释掉翻译管理器并尝试使用 Power Tools,会发生什么情况?
  • 是的,PowerTools 工作正常(Count Items,Page Publisher)。如果我改为注释掉翻译管理器,一切正常,包括 PowerTools,并且没有更多的 Javascript 错误。我已经在 Tridion Support 上开了一张票,但由于他们不支持 PowerTools,他们建议我在 Stackoverflow 上发帖。现在在我看来,问题确实与翻译管理器有关。

标签: javascript translation tridion


【解决方案1】:

这里奇怪的是它指的是不打算从仪表板调用或使用的保存命令。

我建议禁用 JS 缩小(System.config 中的 JScriptMinifier 过滤器),因为它可能会显示更正确的细节。

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

--

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

PowerTools 未定义

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

如果添加我会感到惊讶

Type.registerNamespace("PowerTools");

文件顶部会解决一个问题,因为在我的情况下,无论是否包含 TM,它都会破坏整个 GUI。

【讨论】:

    【解决方案2】:

    我确实检查了 *\PowerTools\Editor\PowerTools\Client\Shared\Scripts\ProgressDialog\ProgressDialog.js,但是这条线

    Type.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]);
    };
    

    【讨论】:

      【解决方案3】:

      好的。现在很清楚了。

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

      同时 TM 认为“保存”只会在 ItemToolbar 上使用。

      导致问题的此工具栏之间的区别在于,仪表板视图可以有任意长度的选择,而项目视图将始终选择具有一个项目(当前打开)。

      尚未进行打开空仪表板选择,ItemCommenting 尝试通过调用 Save 来检查其可用性,该调用调用其所有扩展。只要选择是空的

      var itemUri = selection.getItem(0);

      将返回null,以及

      $models.getItem(null)

      您可以做的是删除 ItemCommenting 扩展命令,因为它在 tridion 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]

      【讨论】:

      • 非常感谢 UI Beardcore!它成功了。没有更多的 JS 错误,Powertools 现在似乎工作正常,除了 CountItems 总是返回相同的结果,无论我选择什么文件夹......但这一定是另一个不相关的问题。
      猜你喜欢
      • 2012-07-02
      • 2012-07-05
      • 1970-01-01
      • 2012-10-10
      • 1970-01-01
      • 1970-01-01
      • 2012-07-22
      • 2012-07-13
      • 1970-01-01
      相关资源
      最近更新 更多