https://git.koha-community.org/Koha-community/Koha/src/commit/36c4d315c8b4bac116377d7fac4d9e51414c7f80/admin/auth_tag_structure.pl#L160 attempts to send you back to the page where you were when you deleted a tag from an authority framework, but since the previous line sets my $tagfield = $input->param('tagfield'); when the actual param is 'searchfield' ('tagfield' is only set when you are creating a new tag, editing tags misuses 'searchfield' whether or not you searched for it) so it fails. Whether or not that redirect is the right thing to do is bug 37162 once bug 37161 decides what approach to use, but those may or may not go back through every supported version since they probably depend on the CSRF changes, and this has been busted since bug 918 landed in 2009.
Created attachment 167999 [details] [review] 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
Well, the URL is ?searchfield=093, not 092, since searchfield is intentionally the one you deleted, not what was in the search field at the time. That was just a typo.
Phil, Without this patch applied I am unable to recreate the problem described in your test plan.
Interesting. That means you have $input->param('tagfield') defined as 092 when you submit a form with four params: csrf_token, op, authtypecode, and searchfield. How?
I am recreating this problem and applying the patch fixes the issue as described.
Created attachment 168031 [details] [review] 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 <samalau@gmail.com>
Created attachment 168110 [details] [review] 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 <samalau@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed for 24.11! Well done everyone, thank you!