From 39145f998d521b86d3a96db499995803970c732e 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 Signed-off-by: Sam Lau Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer (cherry picked from commit d3401535b5c2e66537abe6e0f997e34c91d8e273) Signed-off-by: Lucas Gass (cherry picked from commit 4085efac2345f5edef264cccfb7091ffb374fd0b) Signed-off-by: Fridolin Somers --- 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 1c952d58a5..4970d2237e 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 '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.39.5