From 700ff3508b0eb47d4e0c42c47538f68328345917 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 2 Feb 2024 10:47:17 +0000 Subject: [PATCH] Bug 34478: Changes for admin/koha2marclinks Signed-off-by: Jonathan Druart --- admin/koha2marclinks.pl | 7 ++++--- .../intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/koha2marclinks.pl b/admin/koha2marclinks.pl index 769422bcf3..98a7a533cc 100755 --- a/admin/koha2marclinks.pl +++ b/admin/koha2marclinks.pl @@ -28,7 +28,8 @@ use Koha::BiblioFrameworks; use Koha::Caches; use Koha::MarcSubfieldStructures; -my $input = CGI->new; +my $input = CGI->new; +my $op = $input->param('op') // q{}; my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( { @@ -45,7 +46,7 @@ my $cache = Koha::Caches->get_instance(); # Update data before showing the form my $no_upd; -if( $input->param('add_field') && $input->request_method eq 'POST' ) { +if( $input->param('add_field') && $op eq 'cud-save' ) { # add a mapping to all frameworks my ($kohafield, $tag, $sub) = split /,/, $input->param('add_field'), 3; my $rs = Koha::MarcSubfieldStructures->search({ tagfield => $tag, tagsubfield => $sub }); @@ -55,7 +56,7 @@ if( $input->param('add_field') && $input->request_method eq 'POST' ) { $template->param( error_add => 1, error_info => "$tag, $sub" ); } -} elsif( $input->param('remove_field') && $input->request_method eq 'POST' ) { +} elsif( $input->param('remove_field') && $op eq 'cud-save' ) { # remove a mapping from all frameworks my ($tag, $sub) = split /,/, $input->param('remove_field'), 2; Koha::MarcSubfieldStructures->search({ tagfield => $tag, tagsubfield => $sub })->update({ kohafield => undef }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt index d221b25b5a..c11d9c9095 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt @@ -75,6 +75,7 @@ + -- 2.39.5