From 1adb0afa4c90473cbea4b2d8b54ed53477744322 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 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. Signed-off-by: Julian Maurice Signed-off-by: Paul Poulain --- C4/Search.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a06dcf6bba..b0085c4bb8 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"); -- 2.39.5