From f27d454048bca9d9ebdc1f781a688c2311952786 Mon Sep 17 00:00:00 2001
From: Fridolin Somers
Date: Mon, 17 Nov 2014 16:32:20 +0100
Subject: [PATCH] Bug 13268 - biblioitems.size value not correctly displayed
(more)
Bug partially corrected by Bug 11357.
The size column in biblioitems is a bit problematic when used in TT, because instead of the size value from the biblio column it will give you the size of the variable or current loop.
It's currently used in the templates like opac-topissues.tt :
[% IF results_loo.size %][% results_loo.size %][% END %]
This patch corrects by using item() TT method.
See http://stackoverflow.com/questions/2311303/how-can-i-handle-hash-keys-containing-illegal-identifier-characters-in-template.
Test plan :
- Be sure there is a mapping between a MARC field and biblioitems.size
- Create a record A with biblioitems.size defined : like "10x12"
- Create a record B with no value in biblioitems.size
- Check each modified page :
=> Without this patch : you see a number (loop size) for both records
=> With this patch : you only see the correct value for A and nothing for B
Signed-off-by: Jonathan Druart
Signed-off-by: Chris Cormack
Signed-off-by: Katrin Fischer
Signed-off-by: Tomas Cohen Arazi
---
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt | 2 +-
koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt | 2 +-
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 2 +-
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
index 39d99371dd..561981691e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
@@ -121,7 +121,7 @@
[% IF ( resultsloo.edition ) %]Edition: [% resultsloo.edition %][% END %]
[% IF ( resultsloo.place ) %] ; [% resultsloo.place %][% END %]
[% IF ( resultsloo.pages ) %] - [% resultsloo.pages %][% END %]
- [% IF ( resultsloo.size ) %] ; [% resultsloo.size %][% END %]
+ [% IF ( resultsloo.item('size') ) %] ; [% resultsloo.item('size') %][% END %]
[% IF ( resultsloo.timestamp ) %] (modified on [% resultsloo.timestamp %])[% END %]
[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
index b2477065d7..6dced76548 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
@@ -73,7 +73,7 @@ $(document).ready(function() {
[% IF ( itemsloo.publicationyear ) %], [% itemsloo.publicationyear %]
[% ELSIF ( itemsloo.copyrightdate ) %], [% itemsloo.copyrightdate %][% END %]
[% IF ( itemsloo.pages ) %]: [% itemsloo.pages %] [% END %]
- [% IF ( itemsloo.size ) %][% itemsloo.size %][% END %] [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn %][% END %]
+ [% IF ( itemsloo.item('size') ) %][% itemsloo.item('size') %][% END %] [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn %][% END %]
[% AuthorisedValues.GetByCode( 'CCODE', itemsloo.ccode ) %] |
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
index 4b929d2626..a7f982bbab 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
@@ -381,7 +381,7 @@
[% END %]
[% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %]
[% IF ( itemsloo.notes ) %], [% itemsloo.notes|html %][% END %]
- [% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %]
+ [% IF ( itemsloo.item('size') ) %] [% itemsloo.item('size') %][% END %]
Holdings:
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt
index 72f8abd9be..d7050548f3 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt
@@ -72,7 +72,7 @@
[% results_loo.copyrightdate %]
[% END %]
[% IF ( results_loo.pages ) %] - [% results_loo.pages %][% END %]
- [% IF ( results_loo.size ) %][% results_loo.size %][% END %]
+ [% IF ( results_loo.item('size') ) %][% results_loo.item('size') %][% END %]
[% IF ( results_loo.description ) %]
|