Bug 9276 - Display of biblio-level auth vals on OPAC search broken
authorOwen Leonard <oleonard@myacpl.org>
Wed, 12 Dec 2012 16:43:27 +0000 (11:43 -0500)
committerChris Cormack <chris@bigballofwax.co.nz>
Fri, 1 Feb 2013 08:08:58 +0000 (21:08 +1300)
commit188ac0a8c97259c927096fcb917b356e6edbb0b9
treeeb846fd01de9e510ab7a731ec6405886258f019e
parenteb9af39998d40014391b907f14a7d161fd4543f5
Bug 9276 - Display of biblio-level auth vals on OPAC search broken

If you have your MARC framework configured to link a biblio-level
field with an authorized value, and that value is linked to an
image, and the AuthorisedValueImages system preference is turned on,
the OPAC is supposed to display that image in search results
much like item type images are displayed if item-level itemtypes
are enabled. The switch to Template::Toolkit broke this feature
with a variable scope error.

This patch corrects the variable scope of the sytem preference check
and adds a check for the existence of the image so that the template
doesn't try to display broken images.

To test:

1. Turn on the AuthorisedValueImages system preference.
2. If necessary, create or configure an authorized value with images.
3. Configure a MARC framework to link a field to the authorized value. I
   chose an arbitrary field, 942e.
4. Edit a bibliographic record and set a value for the MARC field
   you configured.
5. Make sure Zebra has reindexed, and perform an OPAC search which
   will include the record you edited. With AuthorisedValueImages
   ON, you should see the correct authorized value image.
6. With AuthorisedValueImages OFF, you should see no image.
7. Turn AuthorisedValueImages back on. Edit the authorized value again
   and configure it with no image. Perform your search again. You should
   see no image.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt