Bug 12336

Summary: Author of reserved book is not displayed in opac-user.pl
Product: Koha Reporter: Viktor Sarge <viktor.sarge>
Component: OPACAssignee: Viktor Sarge <viktor.sarge>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: chris, gmcharlt, jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Fix for author of reserved book not displaying in Opac 12336
Bug 12336 - [SIGNED-OFF] Author of reserved book is not displayed in opac-user.pl
Bug 12336 - [SIGNED-OFF] Author of reserved book is not displayed in opac-user.pl

Description Viktor Sarge 2014-05-30 11:17:01 UTC
When viewing reserved books in the opac in opac-user.pl only title is displayed and no author. This is odd since opac-user.tt actually tries to output [% RESERVE.author %]. The fix seems to be to add $res->{'author'} = $biblioData->{'author'}; at the appropriate place in opac-user.pl so that the template file actually has a value to output in [% RESERVE.author %]

Extra cred to cait for helping me out and stripping down my solution to 50% of the code for a total of adding 1 line in 1 file :) 

If I can wrap my head around git-bz I'll send a patch for this.
Comment 1 Viktor Sarge 2014-06-02 10:56:00 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2014-06-02 18:27:21 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-06-03 07:53:47 UTC
Created attachment 28632 [details] [review]
Bug 12336 - [SIGNED-OFF] Author of reserved book is not displayed in opac-user.pl

This patch adds a line in opac-user.pl passing author info to opac-user.tt
Thanks to cait for helping me out and showing me how to solve this with half the amount of code.

Test plan:
* Reserve a book.
* Go to the opac and log in as the patron you reserved the book for.
* Apply the patch with change to opac-user.pl
* Revisit the opac and refresh it.
* See if author now shows up

Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
Created a hold. Author is not shown n the public catalogue before
applying the patch, but it does show after applying the patch. Way
to go, Viktor!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Jonathan Druart 2014-06-03 07:55:31 UTC
I think this is more a bugfix than an enh.
Comment 5 Viktor Sarge 2014-06-03 08:01:48 UTC
(In reply to Jonathan Druart from comment #4)
> I think this is more a bugfix than an enh.

I agree Jonathan. I fixes that opac-user.tt tries to output a value that opac-user.pl don't create. I understand that I should add [ENH] to enh. bugs - is there something I should do to flag it as a bug?
Comment 6 Jonathan Druart 2014-06-03 10:41:38 UTC
(In reply to Viktor Sarge from comment #5)
> I agree Jonathan. I fixes that opac-user.tt tries to output a value that
> opac-user.pl don't create. I understand that I should add [ENH] to enh. bugs
> - is there something I should do to flag it as a bug?

You can just change the severity with the dropdown list near "Importance:". The values are "critical", "normal", ..., "enhancement", "new feature".
Comment 7 Tomás Cohen Arazi 2014-06-04 21:15:34 UTC
Patch pushed to master.

Thanks Viktor!
Comment 8 Galen Charlton 2014-06-04 21:18:28 UTC
Pushed to 3.16.x for inclusion in 3.16.1.

Congratulations for having your first patch accepted into Koha, Viktor!
Comment 9 Viktor Sarge 2014-06-12 09:13:46 UTC
Thank you! This is great fun. And the timing is spotless - now I can publish post #100 on our blog with the news of my first patch being accepted :) 

(In reply to Galen Charlton from comment #8)
> Pushed to 3.16.x for inclusion in 3.16.1.
> 
> Congratulations for having your first patch accepted into Koha, Viktor!