Bugzilla – Attachment 27501 Details for
Bug 9612
SRU Response is different when DOM indexing is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PUSHED] Bug 9612: Zconn parameters and elementSetName in _new_Zconn
SIGNED-OFF-Bug-9612-Zconn-parameters-and-elementSe.patch (text/plain), 4.55 KB, created by
Martin Renvoize
on 2014-04-23 16:48:53 UTC
(
hide
)
Description:
[PUSHED] Bug 9612: Zconn parameters and elementSetName in _new_Zconn
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2014-04-23 16:48:53 UTC
Size:
4.55 KB
patch
obsolete
>From 9c8ecca848955c32f5a893c413e87955d73b91e6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 26 Mar 2014 15:25:43 +0100 >Subject: [PATCH] [SIGNED OFF] Bug 9612: Zconn parameters and elementSetName > in _new_Zconn > >This patch makes a few adjustments in C4::Context::Zconn. >It does no longer pass the (ignored) auth, syntax parameters to _new_Zconn. >Note that auth was not completely ignored in theory, but we never pass >auth=1 [while not having user/password in koha-conf]. > >Furthermore, it removes the elementSetName for dom indexing. Using marcxml >here does not make a difference. It only adds a constraint on what is in >the dom-config files. (It could probably be removed there now..) > >Two cosmetic code changes: >Removes unused label retry. >And moved 'servername' into the database name option. > >Test plan: >When using Zebra with dom indexing, do a biblio and authority search. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Context.pm | 29 ++++++++++++----------------- > 1 file changed, 12 insertions(+), 17 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 71a0f8c..197ef25 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -689,6 +689,8 @@ C<$auth> whether this connection has rw access (1) or just r access (0 or NULL) > > sub Zconn { > my ($self, $server, $async, $auth, $piggyback, $syntax) = @_; >+ #TODO: We actually just ignore the auth and syntax parameter >+ #It also looks like we are not passing auth, piggyback, syntax anywhere > > my $cache_key = join ('::', (map { $_ // '' } ($server, $async, $auth, $piggyback, $syntax))); > if ( defined($context->{"Zconn"}->{$cache_key}) && (0 == $context->{"Zconn"}->{$cache_key}->errcode()) ) { >@@ -703,7 +705,7 @@ sub Zconn { > # the basic health of a ZOOM::Connection > $context->{"Zconn"}->{$cache_key}->destroy() if defined($context->{"Zconn"}->{$cache_key}); > >- $context->{"Zconn"}->{$cache_key} = &_new_Zconn($server,$async,$auth,$piggyback,$syntax); >+ $context->{"Zconn"}->{$cache_key} = &_new_Zconn( $server, $async, $piggyback ); > return $context->{"Zconn"}->{$cache_key}; > } > } >@@ -723,15 +725,15 @@ C<$auth> whether this connection has rw access (1) or just r access (0 or NULL) > =cut > > sub _new_Zconn { >- my ($server,$async,$auth,$piggyback,$syntax) = @_; >+ my ( $server, $async, $piggyback ) = @_; > > my $tried=0; # first attempt > my $Zconn; # connection object > my $elementSetName; > my $index_mode; >+ my $syntax; > > $server //= "biblioserver"; >- $syntax //= "XML"; > > if ( $server eq 'biblioserver' ) { > $index_mode = $context->{'config'}->{'zebra_bib_index_mode'} // 'grs1'; >@@ -740,36 +742,31 @@ sub _new_Zconn { > } > > if ( $index_mode eq 'grs1' ) { >- > $elementSetName = 'F'; > $syntax = ( $context->preference("marcflavour") eq 'UNIMARC' ) > ? 'unimarc' > : 'usmarc'; > >- } else { >- >- $elementSetName = 'marcxml'; >- $syntax = 'XML'; >+ } else { # $index_mode eq 'dom' >+ #we do not need an elementSetName >+ $syntax = 'xml'; > } > > my $host = $context->{'listen'}->{$server}->{'content'}; >- my $servername = $context->{"config"}->{$server}; > my $user = $context->{"serverinfo"}->{$server}->{"user"}; > my $password = $context->{"serverinfo"}->{$server}->{"password"}; >- $auth = 1 if($user && $password); >- retry: > eval { > # set options > my $o = new ZOOM::Options(); >- $o->option(user=>$user) if $auth; >- $o->option(password=>$password) if $auth; >+ $o->option(user => $user) if $user && $password; >+ $o->option(password => $password) if $user && $password; > $o->option(async => 1) if $async; > $o->option(count => $piggyback) if $piggyback; > $o->option(cqlfile=> $context->{"server"}->{$server}->{"cql2rpn"}); > $o->option(cclfile=> $context->{"serverinfo"}->{$server}->{"ccl2rpn"}); > $o->option(preferredRecordSyntax => $syntax); >- $o->option(elementSetName => $elementSetName); >- $o->option(databaseName => ($servername?$servername:"biblios")); >+ $o->option(elementSetName => $elementSetName) if $elementSetName; >+ $o->option(databaseName => $context->{"config"}->{$server}||"biblios"); > > # create a new connection object > $Zconn= create ZOOM::Connection($o); >@@ -781,9 +778,7 @@ sub _new_Zconn { > if ($Zconn->errcode() !=0) { > warn "something wrong with the connection: ". $Zconn->errmsg(); > } >- > }; >- > return $Zconn; > } > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9612
:
26625
|
26626
|
27500
| 27501 |
28016
|
28017
|
28018
|
28019
|
28138
|
28261
|
28323