From 0a7b06b855988590eb05c7e39bda51d2e9988aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= Date: Wed, 29 Oct 2025 17:05:52 -0300 Subject: [PATCH] Bug 41136: Allow advanced editor to search SRU servers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes the advanced editor be able to search on SRU servers also, instead of only Z39.50. To test: 0. On a fresh KTD 1. Enable and open the cataloguing advanced editor 2. Click on 'Advanced >>' on the left column => FAIL: Only non-SRU targets are displayed 3. Apply this patch and reload 4. Repeat 2 => SUCCESS: SRU server displayed! => SUCCESS: No authority server is displayed due to the change i.e. behavior remains unchanged besides SRU support 5. Choose the sample SRU server and make a search => SUCCESS: Things work 6. Sign off :-D Signed-off-by: Tomás Cohen Arazi --- cataloguing/editor.pl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cataloguing/editor.pl b/cataloguing/editor.pl index b40d4c3ecc9..466f9081353 100755 --- a/cataloguing/editor.pl +++ b/cataloguing/editor.pl @@ -30,6 +30,7 @@ use Koha::Database; use Koha::MarcSubfieldStructures; use Koha::BiblioFrameworks; use Koha::KeyboardShortcuts; +use Koha::Z3950Servers; my $input = CGI->new; @@ -76,14 +77,11 @@ $template->{VARS}->{authtags} = $authtags; my $frameworks = Koha::BiblioFrameworks->search( {}, { order_by => ['frameworktext'] } ); $template->{VARS}->{frameworks} = $frameworks; -# Z39.50 servers -my $dbh = C4::Context->dbh; -$template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( - q{ - SELECT * FROM z3950servers - WHERE recordtype != 'authority' AND servertype = 'zed' - ORDER BY `rank`,servername -}, { Slice => {} } +$template->param( + z3950_servers => Koha::Z3950Servers->search( + { recordtype => { '!=' => 'authority' } }, + { order_by => [ 'rank', 'servername' ] }, + ) ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.51.2