From eef9897e102392e3775f140d62f9e434fd3cead9 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Wed, 15 Aug 2012 15:48:05 -0400 Subject: [PATCH] Bug 8648: searchResults uses SQL query rather than GetMarcFromKohaField Content-Type: text/plain; charset="UTF-8" Around line 1470-something: my $sth = $dbh->prepare( "SELECT tagfield FROM marc_subfield_structure WHERE kohafield LIKE 'items.itemnumber'" ); $sth->execute; This patch replaces that with a call to GetMarcFromKohaField. To test: 1) Apply patch. 2) Do a search that returns both available and unavailable items. You'll know if the patch isn't working. --- C4/Search.pm | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index fd81610..0c7e151 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1469,12 +1469,7 @@ sub searchResults { } #search item field code - my $sth = - $dbh->prepare( -"SELECT tagfield FROM marc_subfield_structure WHERE kohafield LIKE 'items.itemnumber'" - ); - $sth->execute; - my ($itemtag) = $sth->fetchrow; + my ($itemtag, undef) = &GetMarcFromKohaField( "items.itemnumber", "" ); ## find column names of items related to MARC my $sth2 = $dbh->prepare("SHOW COLUMNS FROM items"); -- 1.7.2.5