Koha/C4
David Cook ceada35e00 Bug 10466: fix glitch in OPAC display of titles saved to list
When displaying (in the OPAC) the set of records saved to a list,
an apparently random number (typically 33 or 34) is sometimes
displayed at the end of the publication description.  In particular,
this can occur when XSLT is *not* being used to display search results;
this patch corrects the problem.

Now for the technical details:

This patch checks to see if "size" is undefined. If it is, we add a
blank (i.e. "") value to it in place of undef.

If we do not do this, calling "itemloo.size" will return the size
of the "itemloo" hash, rather than the value for the "size" key.

This is because "size" is a virtual method in Template Toolkit. It's
uncertain why the value is retrieved for the "size" key when there is
a defined value and why TT doesn't use the method instead, and that
it uses "size" as a method only if there is either no "size" key or
if the value tied to the "size" key is null/undef. This might be a
feature or it might be a bug in TT...

In the meantime, we will check to see if it's undefined. If it is,
we'll give it a value.

This bug has been identified in the opac-search.pl, search.pl and
addbooks.pl pages before. To address it, we're currently checking
if there is a "size" key, and if not...we're adding one with a blank
value.

This patch takes up that same idea, although I think it might be better
to rename the variable before passing it to TT in case the behaviour
of TT changes in the future in regards to how it handles virtual
methods.

N.B. Obviously, this only affects users not using XSLTs.

--

Test Plan:

Before applying the patch:

0) Make sure you have opac search result XSLT turned off

1) Find bib records that do not have a 300$c (Dimensions) value.
2) Find bib records that do have a 300$c (Dimensions) value.

(N.B. These values should be stored in the `size` column of biblioitems).

3) Add items from both sets of records to a List
4) Note that records without a 300$c will display a number at the end
of the "Publication" description/string. It should be something like
33 or 34 in most cases.
5) Note that records with a 300$c don't display this number. They just
show the value from 300$c.

Apply the patch.

6) Clear your cache, refresh the page, etc.
7) Note that the number (e.g. 33 or 34) has disappeared from the end
of the "Publication" description/string.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Added a small comment at the end of this one line.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-06-14 16:28:56 -07:00
..
AuthoritiesMarc Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Barcodes Bug 6679 - [SIGNED-OFF] fix 6 perlcritic violations in C4/Barcodes/hbyymmincr.pm 2012-09-20 12:01:36 +02:00
ClassSortRoutine bug 6281: introduce LC::CallNumber::LC for sorting LC call numbers 2013-06-10 07:56:53 -07:00
Creators Bug 9535 - Patron card creator "Remove duplicates" function doesn't work 2013-04-03 06:09:06 -04:00
External Bug 6679 - fix 12 perlcritic violations in C4/External/BakerTaylor.pm 2012-09-20 11:38:45 +02:00
Form Talking Tech Support - Phase I - Followup - Fix Messaging Preferences 2012-06-10 17:46:58 +02:00
Heading Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
ILSDI Bug 9019: Return item fields in ILS-DI GetRecords 2012-12-11 08:33:04 -05:00
Installer bug 6281: add Library::CallNumber::LC as a required Perl dependency 2013-06-10 07:56:53 -07:00
Labels bug 9370: improve splitting of LC call numbers for labels 2013-06-12 07:44:10 -07:00
Linker Bug 8447: Make sure we have enough subfields for broader_headings 2012-09-14 14:56:48 +02:00
Members Bug 7919: Fix unit test (Members_AttributeTypes.t) 2012-12-07 18:26:37 -05:00
OAI Bug 6440: Implement OAI-PMH Sets 2012-03-20 11:38:26 +01:00
Output Fix FSF address in directory C4/ 2010-03-16 20:17:56 -04:00
Patroncards Bug 8315 - remove use C4::* version 2012-07-13 14:17:20 +02:00
Reports Bug 9659 - Better handling of non-existent authorised value categories used in SQL reports 2013-04-26 08:07:24 -04:00
Search Bug 5385: POD Cleanups (part 1) 2010-11-12 10:06:55 +13:00
SIP Bug 9838: fix on 04patron_status.t 2013-04-02 08:30:21 -04:00
Utils Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
VirtualShelves Bug 10466: fix glitch in OPAC display of titles saved to list 2013-06-14 16:28:56 -07:00
Accounts.pm Bug 6413 - QA Followup - Add notes for 'Pay selected' 2013-05-21 16:32:12 -07:00
Acquisition.pm Bug 10381: POD lines of GetBasketsInfosByBookseller 2013-05-30 08:40:27 -07:00
Auth.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Auth_cas_servers.yaml.orig Bug 5630 CAS improvements 2011-10-13 10:49:49 +13:00
Auth_with_cas.pm Bug 8279: CAS Debugging improvements 2012-06-27 18:05:02 +02:00
Auth_with_ldap.pm Bug 7973 : Follow up to remove an extraneous my 2013-03-22 22:01:22 -04:00
AuthoritiesMarc.pm Bug 5635: bulkmarcimport new parameters & features 2013-03-21 20:21:54 -04:00
BackgroundJob.pm Bug 6679 - [SIGNED-OFF] fix 2 perlcritic violations in C4/BackgroundJob.pm 2012-09-20 12:01:40 +02:00
Barcodes.pm Bug 6679 - [SIGNED-OFF] fix 8 perlcritic violations in C4/Barcodes.pm 2012-09-20 12:01:36 +02:00
Biblio.pm Bug 7440 - Remove NoZebra vestiges 2013-03-19 21:17:04 -04:00
Bookseller.pm Bug 8164: Replace IFNULL with COALESCE 2012-11-28 19:08:29 -05:00
Boolean.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Branch.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Breeding.pm Bug 9986: Two fixes for Z3950 search 2013-04-15 08:44:11 -04:00
Budgets.pm Bug 5343: Link serial and acqui modules 2013-03-22 23:54:43 -04:00
Calendar.pm Bug 7351 : feature that allows to delete a range of dates 2012-09-28 12:19:45 +02:00
Category.pm Bug 7919: FIX the "all" categories method 2013-01-02 16:50:52 -05:00
Charset.pm Bug 8347 - Koha forces UNIMARC 100 field code language to 'fre' 2013-02-20 09:06:57 -05:00
Circulation.pm Bug 10262 - fine calculation at checkin not respecting CircControl 2013-05-28 08:31:34 -07:00
ClassSortRoutine.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
ClassSource.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Context.pm Revert "Bug 6554 - make Koha internally utf-8 clean" 2013-04-29 15:12:32 -07:00
Contract.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
CourseReserves.pm bug 8215: (followup) rename GetItemReservesInfo 2013-05-21 15:51:03 -07:00
Creators.pm Bug 8315 - remove use C4::* version 2012-07-13 14:17:20 +02:00
Csv.pm Bug 7986: Export issues for patron 2012-09-13 17:58:30 +02:00
Dates.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Debug.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Heading.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
HoldsQueue.pm Bug 10311 - Holds queue ignores item-level holds where only one items exists 2013-06-10 09:08:16 -07:00
HTML5Media.pm Bug 8377: Followup move style in a css file and do not pass template to a pm 2012-12-27 09:28:00 -05:00
Images.pm Bug 8710 - Don't show the images tab in the OPAC if the record has no local images 2012-11-28 18:54:40 -05:00
ImportBatch.pm Bug 10230: Don't limit valid matches to bibs 2013-05-19 08:40:13 -04:00
ImportExportFramework.pm Bug 6679 - [SIGNED-OFF] fix 15 perlcritic violations in C4/ImportExportFramework.pm 2012-09-20 12:00:55 +02:00
Input.pm Bug 7919 : Display of values depending on the connexion library 2012-12-05 10:10:57 -05:00
Installer.pm Bug 9752: Set marcflavour to NORMARC when NORMARC is chosen 2013-03-30 22:51:17 -04:00
ItemCirculationAlertPreference.pm Bug 6679 - [SIGNED-OFF] fix 2 perlcritic violations in C4/ItemCirculationAlertPreference.pm 2012-09-20 12:01:39 +02:00
Items.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
ItemType.pm Revert "Bug 6554 - make Koha internally utf-8 clean" 2013-04-29 15:12:32 -07:00
Koha.pm Bug 8215 - Course Reserves 2013-05-21 15:50:55 -07:00
Labels.pm Bug 8315 - remove use C4::* version 2012-07-13 14:17:20 +02:00
Languages.pm Bug 8954: Make languages list in advanced search translatable (revision 1) 2012-11-20 14:39:56 -05:00
Letters.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Linker.pm Bug 7284: Fix unit test broken by erroneous POD 2012-03-08 15:24:18 +01:00
Log.pm Bug 7067 - OPAC Borrower Self Registration 2012-12-14 08:08:59 -05:00
Maintainance.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Matcher.pm Bug 10230: no need to use SimpleSearch for matching auths 2013-05-19 08:40:13 -04:00
Members.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Message.pm Bug 6679 - [SIGNED-OFF] fix 3 perlcritic violations in C4/Message.pm 2012-09-20 12:01:39 +02:00
NewsChannels.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Output.pm Complete revert of 6554 2013-05-03 07:58:50 -07:00
Overdues.pm Bug 10030: QA Followup for trivial false warning detected while testing 2013-05-15 21:51:16 -04:00
Patroncards.pm Bug 8315 - remove use C4::* version 2012-07-13 14:17:20 +02:00
Print.pm Bug 6679 - [SIGNED-OFF] fix 2 perlcritic violations in C4/Print.pm 2012-09-20 12:17:43 +02:00
Ratings.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Record.pm Bug 9274: Software error in bibtex export 2013-03-30 20:59:41 -04:00
Reports.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Reserves.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Review.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Ris.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
RotatingCollections.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Scheduler.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Scrubber.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Search.pm Bug 9961: Add truncation support to QP driver 2013-05-08 09:44:23 -04:00
Serials.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Service.pm POD Cleanups 2010-06-09 08:38:59 -04:00
ShelfBrowser.pm Bug 6679 - [SIGNED-OFF] fix 4 perlcritic violations in C4/ShelfBrowser.pm 2012-09-20 12:01:37 +02:00
SMS.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
SocialData.pm bug 7470 follow-up, fix POD doc 2012-03-26 17:53:28 +02:00
SQLHelper.pm Bug 6679 - [SIGNED-OFF] fix 3 perlcritic violations in C4/SQLHelper.pm 2012-09-20 12:01:38 +02:00
Stats.pm Bug 4118 - Add Collection Code to Statistics Table 2012-09-13 18:42:46 +02:00
Suggestions.pm Bug 10080 - Change system pref IndependantBranches to IndependentBranches 2013-05-22 07:58:23 -07:00
Tags.pm Bug 9136: C4::Tags not Plack-compatible 2012-12-22 15:47:48 -05:00
Templates.pm Revert "Bug 6554 - make Koha internally utf-8 clean" 2013-04-29 15:12:32 -07:00
TmplToken.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
TmplTokenType.pm Revert "Bug 6679 - [SIGNED-OFF] fix 9 perlcritic violations in C4/TmplTokenType.pm" 2012-09-20 13:29:59 +02:00
TTParser.pm Bug 5327 : Follow up for TTParser test 2012-07-12 16:06:21 +02:00
UploadedFile.pm Bug 7941 : Fix version numbers in modules 2012-06-11 17:29:38 +02:00
Utils.pm Bug 6679 - [SIGNED-OFF] fix 2 perlcritic violations in C4/Utils.pm 2012-09-20 12:01:39 +02:00
VirtualShelves.pm Bug 7368: POD doc in VirtualShelves.pm 2013-03-21 18:33:28 -04:00
XISBN.pm Bug 9726: XISBN service throttle not initialized 2013-03-30 22:05:15 -04:00
XSLT.pm bug 10292: improve fallback logic for picking XSLT 2013-05-29 07:39:41 -07:00