From: miker Date: Sun, 28 Sep 2008 20:52:36 +0000 (+0000) Subject: make in-db authoritative, but allow config file values as well X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5854933237133f6ea8c614d035e3f33f04c80892;p=Evergreen.git make in-db authoritative, but allow config file values as well git-svn-id: svn://svn.open-ils.org/ILS/trunk@10719 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm index 97cf08b06d..6cc8efba84 100755 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm @@ -86,43 +86,42 @@ sub query_services { return $e->event unless $e->checkauth; return $e->event unless $e->allowed('REMOTE_Z3950_QUERY'); - if($e->can('search_config_z3950_source')) { - - my $sources = $e->search_config_z3950_source( - [ { name => { '!=' => undef } }, - { flesh => 1, flesh_fields => { czs => ['attrs'] } }] - ); - - my %hash = (); - for my $s ( @$sources ) { - $hash{ $s->name } = { - name => $s->name, - label => $s->label, - host => $s->host, - port => $s->port, - db => $s->db, - record_format => $s->record_format, - transmission_format => $s->transmission_format, - auth => $s->auth, - }; - - for my $a ( @{ $s->attrs } ) { - $hash{ $a->source }{attrs}{ $a->name } = { - name => $a->name, - label => $a->label, - code => $a->code, - format => $a->format, - source => $a->source, - truncation => $a->truncation, - }; - } - } + my $hash = $sclient->config_value('z3950', 'services'); - return \%hash; + # overlay config file values with in-db values + if($e->can('search_config_z3950_source')) { - } else { - return $sclient->config_value('z3950', 'services'); + my $sources = $e->search_config_z3950_source( + [ { name => { '!=' => undef } }, + { flesh => 1, flesh_fields => { czs => ['attrs'] } } ] + ); + + for my $s ( @$sources ) { + $$hash{ $s->name } = { + name => $s->name, + label => $s->label, + host => $s->host, + port => $s->port, + db => $s->db, + record_format => $s->record_format, + transmission_format => $s->transmission_format, + auth => $s->auth, + }; + + for my $a ( @{ $s->attrs } ) { + $$hash{ $a->source }{attrs}{ $a->name } = { + name => $a->name, + label => $a->label, + code => $a->code, + format => $a->format, + source => $a->source, + truncation => $a->truncation, + }; + } + } } + + return $hash; }