From 1f606cc5539ff16f11fcef046adab55a2d386aa8 Mon Sep 17 00:00:00 2001 From: charles Date: Thu, 28 Dec 2017 15:23:03 -0500 Subject: [PATCH] Bug 11297: QA follow-up - Avoid carrying server attributes As it was pointed out, concatenating server attributes on a variable above the foreach loop meant carrying those attributes through every other queries. With a variable local to the loop, we can now send each server its specific zquery. --- C4/Breeding.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Breeding.pm b/C4/Breeding.pm index f157587..646ac11 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -156,13 +156,14 @@ sub Z3950Search { ); my @servers = $rs->all; foreach my $server ( @servers ) { + my $server_zquery = $zquery; if(my $attributes = $server->{attributes}){ - $zquery = "$attributes $zquery"; + $server_zquery = "$attributes $zquery"; } $oConnection[$s] = _create_connection( $server ); $oResult[$s] = $server->{servertype} eq 'zed'? - $oConnection[$s]->search_pqf( $zquery ): + $oConnection[$s]->search_pqf( $server_zquery ): $oConnection[$s]->search(new ZOOM::Query::CQL( _translate_query( $server, $squery ))); $s++; -- 2.7.4