From cdd4164c75a6243cdefd865c518f7a2d6664293b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 15 Apr 2013 09:23:58 -0400 Subject: [PATCH] Bug 10049 [Alternate] Comments tab shows ( ) instead of ( 0 ) on translated templates Content-Type: text/plain; charset="utf-8" This patch is an alternate solution to the problem of "0" not appearing on the comment tab in translated templates. It uses the Template Toolkit option of specifying a default value for a variable: [% reviews.size || 0 %] This syntax is already in use elsewhere in the template. Same test plan: 1) Make sure comments/reviews are activated 2) Find a record with 0 comments/reviews in the opac 3) The tab shows: Comments ( 0 ) 4) Switch to any other languages. 5) Tab now shows: ( ) 6) Apply patch 7) Check English templates stil work correctly 8) Rerun 'perl translate install 9) Check display is now correct. 10) Also check that number shows correctly for records with comments. --- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 3c37bd1..a8dabf3 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -946,7 +946,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% END %] [% IF ( reviewson ) %] -
  • Comments ( [% IF reviews.defined %][% reviews.size %][% ELSE %]0[% END %] )
  • +
  • Comments ( [% reviews.size || 0 %] )
  • [% END %] [% IF ( NovelistSelectProfile ) %] -- 1.7.9.5