From ab55fb962117365b3ca796e48d2327b3a88d8c74 Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Tue, 4 Jun 2024 11:49:38 +0200 Subject: [PATCH] Bug 36372 : trigger a record indexing when the record source is set --- cataloguing/record_source.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cataloguing/record_source.pl b/cataloguing/record_source.pl index 5a499299126..6e365cdb3fb 100644 --- a/cataloguing/record_source.pl +++ b/cataloguing/record_source.pl @@ -28,6 +28,8 @@ use C4::Context; use Koha::DateUtils qw( dt_from_string ); use Koha::Biblios; use Koha::RecordSources; +use Koha::SearchEngine; +use Koha::SearchEngine::Indexer; use URI::Escape qw( uri_escape_utf8 ); # ======================== @@ -40,8 +42,10 @@ my $save = $input->param('save') // ''; my $biblio = Koha::Biblios->find($biblionumber); my $current_source = $biblio->metadata->record_source; -if ($save ne '') { +if ($save) { $biblio->metadata->set({record_source_id => $record_source_id})->store; + my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); + $indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); } -- 2.45.1