Bug 5248

Summary: Some descriptions missing in the opac
Product: Koha Reporter: Chad Billman <chad>
Component: OPACAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: PATCH-Sent (DO NOT USE) CC: m.de.rooy
Version: rel_3_0   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Patch for opac-detail

Description Chad Billman 2010-09-24 12:28:05 UTC
Created attachment 2646 [details] [review]
Patch for opac-detail

Certain items were not displaying a description even though they had valid 52x fields in the marc record. This was happening to a number of our records but I haven't been able to narrow down the exact cause of the problem.

I attached a patch that fixes the problem on our 3.0.x install.

Here is a link to the unpatched version of opac-detail.pl
https://library.pennmanor.net/cgi-bin/koha/opac-detail-orig.pl?biblionumber=103230

And to the patched version
https://library.pennmanor.net/cgi-bin/koha/opac-detail.pl?biblionumber=103230
Comment 1 Marcel de Rooy 2010-10-18 13:21:41 UTC
Thank you for this bug report. We also have this issue.

The exact cause of the problem is calling functions like GetNormalized... in list context. Since they return nothing (in this context an empty list), Perl discards this value and the rest of the list shifts one position forward resulting in a mixup of the parameters passed to template->param.

Calling the functions in scalar context before the template->param call as you did in the patch solves the problem. You could also force scalar context with a scalar statement or adding the test ||'' ("OR empty string").
Comment 2 Marcel de Rooy 2010-10-21 07:26:16 UTC
(In reply to comment #1)
> Thank you for this bug report. We also have this issue.
> The exact cause of the problem is calling functions like GetNormalized... in
> list context. Since they return nothing (in this context an empty list), Perl
> discards this value and the rest of the list shifts one position forward
> resulting in a mixup of the parameters passed to template->param.
> Calling the functions in scalar context before the template->param call as you
> did in the patch solves the problem. You could also force scalar context with a
> scalar statement or adding the test ||'' ("OR empty string").

"Since they return nothing" should of course be: "If they return nothing"

Patch sent for 3.0.x.
This problem is already solved in 3.2