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 <jonathan.druart@biblibre.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Fridolin Somers 2014-11-17 16:32:20 +01:00 committed by Mason James
parent 29df56ab95
commit 09f2ca6d44
4 changed files with 4 additions and 4 deletions

View File

@ -117,7 +117,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 ) %] <i>(modified on [% resultsloo.timestamp %])</i>[% END %]
</p>
[% END %]

View File

@ -72,7 +72,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 %]</p>
[% IF ( itemsloo.item('size') ) %][% itemsloo.item('size') %][% END %] [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn %][% END %]</p>
</div>
</td>
<td class="hq-collection">[% AuthorisedValues.GetByCode( 'CCODE', itemsloo.ccode ) %]</td>

View File

@ -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 %]
</span>
<span class="results_summary">
<span class="label">Holdings:</span>

View File

@ -72,7 +72,7 @@
[% results_loo.copyrightdate %]
[% END %]
[% IF ( results_loo.pages ) %] - [% results_loo.pages %][% END %]
[% IF ( results_loo.size ) %][% results_loo.size %][% END %]</p>
[% IF ( results_loo.item('size') ) %][% results_loo.item('size') %][% END %]</p>
</td>
<td>
[% IF ( results_loo.description ) %]