Bug 5248 - Some descriptions missing in the opac
Summary: Some descriptions missing in the opac
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: rel_3_0
Hardware: All All
: PATCH-Sent (DO NOT USE) normal
Assignee: Marcel de Rooy
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-24 12:28 UTC by Chad Billman
Modified: 2010-11-04 09:59 UTC (History)
1 user (show)

See Also:
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 (1.07 KB, patch)
2010-09-24 12:28 UTC, Chad Billman
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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