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> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
3d1b38b0ad
commit
825c6c5edf
2 changed files with 3 additions and 26 deletions
|
@ -180,7 +180,9 @@ if ($op eq 'add_form') {
|
|||
$cache->clear_from_cache("MarcStructure-1-$frameworkcode");
|
||||
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
|
||||
$cache->clear_from_cache("MarcCodedFields-$frameworkcode");
|
||||
$template->param( searchfield => $searchfield );
|
||||
print $input->redirect(
|
||||
"/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$searchfield&frameworkcode=$frameworkcode");
|
||||
exit;
|
||||
# END $OP eq DELETE_CONFIRMED
|
||||
################## ITEMTYPE_CREATE ##################################
|
||||
# called automatically if an unexisting frameworkis selected
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
[% IF ( delete_confirm ) %]
|
||||
[% tx("Confirm deletion of tag {searchfield}", { searchfield = searchfield }) | html %] ›
|
||||
[% END %]
|
||||
[% IF ( delete_confirmed ) %]
|
||||
[% t("Data deleted") | html %] ›
|
||||
[% END %]
|
||||
[% IF framework %]
|
||||
[% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) ›
|
||||
[% ELSE %]
|
||||
|
@ -84,20 +81,6 @@
|
|||
[% WRAPPER breadcrumb_item bc_active= 1%]
|
||||
[% tx("Confirm deletion of tag {searchfield}", { searchfield = searchfield }) | html %]
|
||||
[% END %]
|
||||
|
||||
[% ELSIF ( delete_confirmed ) %]
|
||||
[% WRAPPER breadcrumb_item %]
|
||||
<a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% framework.frameworkcode | uri %]">
|
||||
[% IF framework %]
|
||||
<span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
|
||||
[% ELSE %]
|
||||
<span>Default framework</span>
|
||||
[% END %]
|
||||
</a>
|
||||
[% END %]
|
||||
[% WRAPPER breadcrumb_item bc_active= 1%]
|
||||
<span>Data deleted</span>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END #/ WRAPPER breadcrumbs %]
|
||||
[% END #/ WRAPPER sub-header.inc %]
|
||||
|
@ -212,14 +195,6 @@
|
|||
</div>
|
||||
[% END %]
|
||||
|
||||
[% IF ( delete_confirmed ) %]
|
||||
|
||||
<div class="dialog message"><h3>Tag deleted</h3>
|
||||
<form action="[% script_name | html %]" method="post"><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
|
||||
</form></div>
|
||||
[% END %]
|
||||
[% IF ( framework_create ) %]
|
||||
|
||||
<form action="[% script_name | html %]" method="post">
|
||||
|
|
Loading…
Reference in a new issue