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
Looks like it linked to Bug 11692
Created attachment 33615 [details] [review] 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
Against master: cataloguing/addbooks.pl?q=tintin I got: Les Aventures de Tintin. 15 : Objectif Lune [texte et dessins] par Hergé - 2203001151 - 1981 - Casterman - 61 p. ; 30 cm biblioitems.size is mapped with 215$d and is equal to '30 cm'. So what does this patch fix?
(In reply to Jonathan Druart from comment #3) You reproduce the bug in opac-shelves.pl and opac-topissues.pl ?
(In reply to Jonathan Druart from comment #3) > Against master: > > cataloguing/addbooks.pl?q=tintin > > I got: > Les Aventures de Tintin. 15 : Objectif Lune > > [texte et dessins] par Hergé - 2203001151 - 1981 - Casterman - 61 p. ; 30 cm > > > biblioitems.size is mapped with 215$d and is equal to '30 cm'. > > So what does this patch fix? In this page, it works because of ugly hack in cataloguing/addbooks.pl : foreach my $line (@newresults) { if ( not exists $line->{'size'} ) { $line->{'size'} = "" } } Looks like resultsloo.size is the size of loop only when biblioitems.size is undefined.
Created attachment 34286 [details] [review] 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>
Created attachment 34287 [details] [review] Bug 13268: the size should not be emptied in pl script It duplicates what the first patch does. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This is quite annoying because a value is displayed, but not the good one!
Created attachment 34740 [details] [review] 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>
Created attachment 34741 [details] [review] Bug 13268: the size should not be emptied in pl script It duplicates what the first patch does. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 34757 [details] [review] [PASSED QA] 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>
Created attachment 34758 [details] [review] [PASSED QA] Bug 13268: the size should not be emptied in pl script It duplicates what the first patch does. 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>
Patches pushed to master. Thanks Frido and Jonathan!
Pushed to 3.18.x will be in 3.18.4
Possible selection for 3.16.x
Pushed to 3.16.x, will be in 3.16.10