2013-05-16 17 views
3

我怎麼可以寫一個,如果在Bugzilla的模板文件條件來檢查錯誤克隆錯誤如果Bugzilla的模板文件條件來檢查錯誤克隆錯誤

我寫的代碼

[% IF cloned_bug_id eq [% bug.bug_id %] ] 
    <a href="mailto:[% report_name %]">HIIIIIIIIIIII</a> 
[% END %] 

但它示出了錯誤:

URL: http://stagingbugzilla.cpiv.com/html/centralbugzilla/show_bug.cgi?id=3743085 file error - parse error - bug/edit.html.tmpl line 1145: unexpected token (eq) [% IF cloned_bug_id eq [% bug.bug_id %]

+0

它非常迫切。請回復某人 – Monisha

+0

這是非常緊急的。任何人都可以回覆 – Monisha

回答

2

假設這是模板工具包,沒有理由嵌套代碼塊([% %])。另外,eq不用於比較。從模板工具包文檔:

The following conditional and boolean operators may be used:

== != < <= > >= && || ! and or not 

像這樣的東西應該工作:

[% IF cloned_bug_id == bug.bug_id %] 
    <a href="mailto:[% report_name %]">HIIIIIIIIIIII</a> 
[% END %]