Bug 8466

Summary: Holds on MARC records with no item causes silent error in koha-error_log
Product: Koha Reporter: Piotr Kowalski <kolpen>
Component: Hold requestsAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact:
Severity: minor    
Priority: P5 - low CC: gmcharlt, kolpen, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: proposed (two) patches

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 ***