In older versions (I tested in 23.05.11 since I had it handy), when you edit a MARC framework and delete a tag, you get a page saying "Tag deleted" with an OK button, and clicking the button reloads the framework you were in (though not exactly the way it was originally inteded to, since it's supposed to reload with a search for the tagnumber, so you wind up in the same place you were). In main, you don't get the "Tag deleted", which is inside an [% IF ( delete_confirmed ) %]. I don't see what magic was ever setting delete_confirmed, unless it was set by that being the name of the $op back before it became cud-delete_confirmed. https://git.koha-community.org/Koha-community/Koha/src/commit/582d6916c9a4e021641030d8779466cb5f7f6273/acqui/basket.pl#L175 explicitly sets it, but I don't see where anything else does, and if the magic was coming from the $op, then there's a whole bunch more things that need to be fixed to set it.
FWIW, explicitly setting delete_confirmed => 1 in https://git.koha-community.org/Koha-community/Koha/src/commit/b0b168b6f84ef00babf566097933de7a338726a7/admin/marctagstructure.pl#L183 does make the "Tag deleted [OK]" -> redirect thing work again, but magic was nicer. And since the "Tag deleted [OK]" page is really rather silly, it would probably be simpler to copy the authority technique of a redirect in https://git.koha-community.org/Koha-community/Koha/src/commit/36c4d315c8b4bac116377d7fac4d9e51414c7f80/admin/auth_tag_structure.pl#L160 (though maybe actually correctly setting the tag number with "my $tagfield = $input->param('searchfield');" so you go back to where you were, since that's currently setting it to $input->param('tagfield') which doesn't exist).
Fixed the authority tagfield thing in bug 37163
Oh, I see, not magic, just common practice to do something like https://git.koha-community.org/Koha-community/Koha/src/commit/b0b168b6f84ef00babf566097933de7a338726a7/admin/marctagstructure.pl#L79 where you add a template param of $op => 1, which worked fine when it was also common practice to name ops in a way compatible with TT variable names, which are alphanumeric plus underscore, which doesn't include the hyphen in cud-. So every script with a cud- op needs to have its template checked for use of the former op name, and the script needs to be updated to set the non-cud- version of it if the template uses it? Fun!
Luckily, it's also common practice to just redirect to showing the result of a cud- op rather than depending on a template knowing what to do, which limits the damages.
Created attachment 168004 [details] [review] Bug 37161: After deleting a tag in a MARC framework, redirect back to the tag list rather than showing a 'Tag deleted' page first Currently after you delete a tag from a MARC framework, Koha intends to show you a page with the text "Tag deleted" and an OK button to click to go back to where you were in the list of tags. But because that depends on the template variable being set for the name of the op in the script, and the name of the op is "cud-delete_confirmed" which isn't a legal TT variable name, nothing is set to tell the template what to display, so it displays a mostly-blank page. Far better to show, don't tell, and just redirect to the list of tags like deleting a tag from an authority framework does. Test plan: 1. Without the patch, Administration - MARC bibliographic frameworks - Binders row - Actions menu - MARC structure 2. Type 092 and press Enter in the Search for tag: input 3. 092 row - Actions menu - Delete - Yes, delete this tag 4. Stare blankly at the blank page with only a header 5. Apply patch, restart_all 6. Administration - MARC bibliographic frameworks - Kits row - Actions menu - MARC structure 7. Type 092 and press Enter in the Search for tag: input 8. 092 row - Actions menu - Delete - Yes, delete this tag 9. Enjoy the sight of the Kits framework showing a search for 092 that doesn't show one, because you just deleted it, and now you can delete the 096 tag next
Created attachment 168007 [details] [review] Bug 37161: After deleting a tag in a MARC framework, redirect back to the tag list rather than showing a 'Tag deleted' page first Currently after you delete a tag from a MARC framework, Koha intends to show you a page with the text "Tag deleted" and an OK button to click to go back to where you were in the list of tags. But because that depends on the template variable being set for the name of the op in the script, and the name of the op is "cud-delete_confirmed" which isn't a legal TT variable name, nothing is set to tell the template what to display, so it displays a mostly-blank page. Far better to show, don't tell, and just redirect to the list of tags like deleting a tag from an authority framework does. Test plan: 1. Without the patch, Administration - MARC bibliographic frameworks - Binders row - Actions menu - MARC structure 2. Type 092 and press Enter in the Search for tag: input 3. 092 row - Actions menu - Delete - Yes, delete this tag 4. Stare blankly at the blank page with only a header 5. Apply patch, restart_all 6. Administration - MARC bibliographic frameworks - Kits row - Actions menu - MARC structure 7. Type 092 and press Enter in the Search for tag: input 8. 092 row - Actions menu - Delete - Yes, delete this tag 9. Enjoy the sight of the Kits framework showing a search for 092 that doesn't show one, because you just deleted it, and now you can delete the 096 tag next
Created attachment 168032 [details] [review] Bug 37161: After deleting a tag in a MARC framework, redirect back to the tag list rather than showing a 'Tag deleted' page first Currently after you delete a tag from a MARC framework, Koha intends to show you a page with the text "Tag deleted" and an OK button to click to go back to where you were in the list of tags. But because that depends on the template variable being set for the name of the op in the script, and the name of the op is "cud-delete_confirmed" which isn't a legal TT variable name, nothing is set to tell the template what to display, so it displays a mostly-blank page. Far better to show, don't tell, and just redirect to the list of tags like deleting a tag from an authority framework does. Test plan: 1. Without the patch, Administration - MARC bibliographic frameworks - Binders row - Actions menu - MARC structure 2. Type 092 and press Enter in the Search for tag: input 3. 092 row - Actions menu - Delete - Yes, delete this tag 4. Stare blankly at the blank page with only a header 5. Apply patch, restart_all 6. Administration - MARC bibliographic frameworks - Kits row - Actions menu - MARC structure 7. Type 092 and press Enter in the Search for tag: input 8. 092 row - Actions menu - Delete - Yes, delete this tag 9. Enjoy the sight of the Kits framework showing a search for 092 that doesn't show one, because you just deleted it, and now you can delete the 096 tag next Signed-off-by: Sam Lau <samalau@gmail.com>
Created attachment 168033 [details] [review] Bug 37161: After deleting a tag in a MARC framework, redirect back to the tag list rather than showing a 'Tag deleted' page first Currently after you delete a tag from a MARC framework, Koha intends to show you a page with the text "Tag deleted" and an OK button to click to go back to where you were in the list of tags. But because that depends on the template variable being set for the name of the op in the script, and the name of the op is "cud-delete_confirmed" which isn't a legal TT variable name, nothing is set to tell the template what to display, so it displays a mostly-blank page. Far better to show, don't tell, and just redirect to the list of tags like deleting a tag from an authority framework does. Test plan: 1. Without the patch, Administration - MARC bibliographic frameworks - Binders row - Actions menu - MARC structure 2. Type 092 and press Enter in the Search for tag: input 3. 092 row - Actions menu - Delete - Yes, delete this tag 4. Stare blankly at the blank page with only a header 5. Apply patch, restart_all 6. Administration - MARC bibliographic frameworks - Kits row - Actions menu - MARC structure 7. Type 092 and press Enter in the Search for tag: input 8. 092 row - Actions menu - Delete - Yes, delete this tag 9. Enjoy the sight of the Kits framework showing a search for 092 that doesn't show one, because you just deleted it, and now you can delete the 096 tag next Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Eric Garcia <cubingguy714@gmail.com>
Created attachment 168108 [details] [review] Bug 37161: After deleting a tag in a MARC framework, redirect back to the tag list rather than showing a 'Tag deleted' page first Currently after you delete a tag from a MARC framework, Koha intends to show you a page with the text "Tag deleted" and an OK button to click to go back to where you were in the list of tags. But because that depends on the template variable being set for the name of the op in the script, and the name of the op is "cud-delete_confirmed" which isn't a legal TT variable name, nothing is set to tell the template what to display, so it displays a mostly-blank page. Far better to show, don't tell, and just redirect to the list of tags like deleting a tag from an authority framework does. Test plan: 1. Without the patch, Administration - MARC bibliographic frameworks - Binders row - Actions menu - MARC structure 2. Type 092 and press Enter in the Search for tag: input 3. 092 row - Actions menu - Delete - Yes, delete this tag 4. Stare blankly at the blank page with only a header 5. Apply patch, restart_all 6. Administration - MARC bibliographic frameworks - Kits row - Actions menu - MARC structure 7. Type 092 and press Enter in the Search for tag: input 8. 092 row - Actions menu - Delete - Yes, delete this tag 9. Enjoy the sight of the Kits framework showing a search for 092 that doesn't show one, because you just deleted it, and now you can delete the 096 tag next Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Eric Garcia <cubingguy714@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed for 24.11! Well done everyone, thank you!