From a3b5fb2b9f44526b472833cb2e87d16903497b4d 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 --- C4/Search.pm | 7 +------ 1 file changed, 1 insertion(+), 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.10.4