Bug 8466 - Holds on MARC records with no item causes silent error in koha-error_log
Summary: Holds on MARC records with no item causes silent error in koha-error_log
Status: RESOLVED DUPLICATE of bug 12522
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 11:50 UTC by Piotr Kowalski
Modified: 2014-07-03 12:36 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
proposed (two) patches (907 bytes, text/plain)
2012-07-18 11:50 UTC, Piotr Kowalski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kowalski 2012-07-18 11:50:50 UTC
Created attachment 10931 [details]
proposed (two) patches

While cataloging, viewing MARC details of record that hasn't items yet, a silent error occurs in koha-error_log when a librarian clicks on the "Holds" tab.
The error messages are like that:
request.pl: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3 at /usr/share/koha/lib/C4/Koha.pm line 811., 
request.pl: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/koha/lib/C4/Koha.pm line 814., 

The reason is an empty items value in dynamically build query in procedures:
- Module: Items.pm, procedure: GetItemInfosOf
- Module: Biblio.pm, procedure: GetBiblioItemInfosOf

Proposed patch refers to the version 3.6.4

The bug occurs also in later Koha versions (ie. 3.6.6, 3.8) and the same patches should be implemented there (it is only one line add), respectively:
Module: Items.pm - line 1064 in version 3.6.6; line 1069 in version 3.8
Module: Biblio.pm - line 1014 in version 3.6.6; line 1026 in version 3.8
Comment 1 Owen Leonard 2013-04-04 21:37:15 UTC
This bug is valid in master as of 3.12 beta2.
Comment 2 Owen Leonard 2014-07-03 12:36:40 UTC

*** This bug has been marked as a duplicate of bug 12522 ***