2013-02-19 80 views
5

我最近安裝了Tridion 2011 SP1並啓用了SDL模塊翻譯管理器。Tridion 2011 SP1:Tridion GUI安裝了翻譯管理器和Powertools 2011的Javascript錯誤

一切工作正常。然後,我按照安裝程序安裝了Tridion 2011 Powertools。

當試圖重新加載GUI(瀏覽器緩存清空,修改參數來實例化在的WebRoot \配置\ System.Config服務器元素),我發現了以下JavaScript錯誤:

SCRIPT5007: Unable to get value of the property 'getItemType': object is null or undefined
Dashboard_v6.1.0.55920.18_.aspx?mode=js, line 528 character 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的命令註冊或服用點。

試圖通過選擇任意文件夾來瀏覽我的外表套上出版物/ strucutreGroup也可以得到同樣的錯誤和正確的框架(內容框架)將不會顯示任何外表套上項目,但只是顯示:

Loading ...

有沒有人已經遇到類似的問題?

現在我沒有別的選擇,而不是註釋掉電動工具的部分文件

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

謝謝 弗朗索瓦

+0

PowerTools是否真正爲您工作?如果您將Translation Manager註釋掉並嘗試使用Power Tools,會發生什麼情況? – 2013-02-19 16:08:00

+0

是的,PowerTools工作正常(Count Items,Page Publisher)。如果我將Translation Manager改爲註釋掉,那麼一切正常,包括PowerTools,並且不會出現更多Javascript錯誤。 我已經打開了@Tridion支持票,但是因爲他們不支持他們建議我在Stackoverflow上發佈的PowerTools。 現在看來,這個問題實際上與翻譯管理器有關。 – 2013-02-19 16:48:22

回答

1
這裏

奇怪的是,它指的是保存它並非是命令在儀表板中調用或使用。

我建議禁用JS minification(System.config中的JScriptMinifier篩選器),因爲它可能會顯示更多正確的細節。

另一個有用的東西就是這個錯誤調用堆棧。

-

我無法重現從最初的問題的問題,但是當我安裝了PT以下錯誤:

PowerTools is not defined

出現在 * \ PowerTools的\編輯\ PowerTools的\ Client \ Shared \ Scripts \ ProgressDialog \ ProgressDialog.js嘗試註冊PowerToolsBase命名空間,而不是PowerTools

若加入

Type.registerNamespace("PowerTools");

在文件的頂部會解決一個問題,因爲在我的情況下,它被打破整個GUI不管TM包括或沒有我心底感到驚訝。

0

我檢查了* \ 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]); 
}; 
0

好的。現在已經很清楚了。

PowerTools.Commands.ItemComminging用於儀表板工具欄。 此命令使用保存檢查其可用性。

在同一時間TM認爲「保存」將只用於ItemToolbar。

導致問題的這些工具欄之間的區別在於,當項目視圖始終選擇具有一個項目(當前打開)時,儀表板視圖可以具有任意長度選擇。

尚未打開空的儀表板選擇,ItemCommenting會嘗試通過調用Save來檢查其可用性,Save調用其所有擴展。而且只要選擇空

var itemUri = selection.getItem(0);

將返回,以及

$models.getItem(null)

你可以做什麼,是去除ItemCommenting擴展命令,因爲它是在的tridion工具機智能無極幹線編輯器完成的.config。

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

+0

非常感謝你的UI鬍子!它做了詭計。 沒有更多的JS錯誤和Powertools似乎現在正常工作,除了CountItems總是返回相同的結果,無論我選擇的文件夾...但這必須是另一個無關的問題。 – 2013-02-20 14:30:21

相關問題