From 61ca8d04db3cba2a89c37707da80174c3a3bf336 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Fri, 21 Jun 2024 17:43:22 -0700 Subject: [PATCH] Bug 37163: Fix the redirect after deleting a tag from an authority framework to load the right page When you delete a tag from an authority framework, we intend to redirect you right back to where you were, on the same page of tags, but because we pick the wrong variable to set searchfield in the URL, we send you to the first page instead. Test plan: 1. Without the patch, Administration - Authority types - in the row for CHRON_TERM Actions menu, MARC Structure 2. In the Search for tag: input, type 092 and hit Enter 3. In the row for 092, Actions menu, Delete, in the page that loads click Yes, delete 4. In the page you are redirected to, note that you are at Tag 000, and the URL is ?searchfield=&authtypecode=CHRON_TERM 5. Apply patch, restart_all 6. Type 092 and hit Enter, Actions menu for the 093 row, Delete, Yes, delete 7. Note that now you have gone to the page where 093 used to be, because the URL is ?searchfield=092&authtypecode=CHRON_TERM and you can just keep deleting 09x tags one after another --- admin/auth_tag_structure.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl index d4b0662588..14b7f5c90f 100755 --- a/admin/auth_tag_structure.pl +++ b/admin/auth_tag_structure.pl @@ -156,8 +156,7 @@ if ($op eq 'add_form') { } elsif ($op eq 'cud-delete_confirmed') { $dbh->do(q|delete from auth_tag_structure where tagfield=? and authtypecode=?|, undef, $searchfield, $authtypecode); $dbh->do(q|delete from auth_subfield_structure where tagfield=? and authtypecode=?|, undef, $searchfield, $authtypecode); - my $tagfield = $input->param('tagfield'); - print $input->redirect("/cgi-bin/koha/admin/auth_tag_structure.pl?searchfield=$tagfield&authtypecode=$authtypecode"); + print $input->redirect("/cgi-bin/koha/admin/auth_tag_structure.pl?searchfield=$searchfield&authtypecode=$authtypecode"); exit; # END $OP eq DELETE_CONFIRMED ################## ITEMTYPE_CREATE ################################## -- 2.44.0