Bug 37080: Cannot delete MARC bibliographic frameworks or authority types

The scripts for managing both bib and authority frameworks are now expecting
an op 'cud-delete_confirm' but delete_confirm isn't cud, it's just a GET of a
page asking if you are sure. The scripts just need to expect the op they are
actually getting, delete_confirm.

Test plan:
 1. Administration - MARC bibliographic framework - New framework
 2. Give the framework any code and description and Submit
 3. Actions menu for your new framework - Delete
 4. Note the message says 'Confirm deletion of framework '' ()?" rather than
    having the code and description included.
 5. Click Yes, note that deleting failed
 6. Administration - Authority types - New authority type
 7. Give the authority type any type and description and Submit
 8. Actions menu for your authority type - Delete
 9. Note the message again says '' () rather than 'desc' (FOO)
10. Click yes, note that deleting failed
11. Finally! Apply patch, reset_all
12. Repeat steps 1-10, this time noting that you get 'desc' (FOO) rather than
    '' (), and that deleting works.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c81b201dc9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Phil Ringnalda 2024-06-12 19:25:14 -07:00 committed by Lucas Gass
parent 9edb3346f4
commit 3e84279d3e
2 changed files with 2 additions and 2 deletions

View file

@ -82,7 +82,7 @@ if ( $op eq 'add_form' ) {
} }
$op = 'list'; $op = 'list';
} elsif ( $op eq 'cud-delete_confirm' ) { } elsif ( $op eq 'delete_confirm' ) {
my $authority_type = Koha::Authority::Types->find($authtypecode); my $authority_type = Koha::Authority::Types->find($authtypecode);
my $authorities_using_it = Koha::Authorities->search( { authtypecode => $authtypecode } )->count; my $authorities_using_it = Koha::Authorities->search( { authtypecode => $authtypecode } )->count;
$template->param( $template->param(

View file

@ -81,7 +81,7 @@ if ( $op eq 'add_form' ) {
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
$cache->clear_from_cache("MarcCodedFields-$frameworkcode"); $cache->clear_from_cache("MarcCodedFields-$frameworkcode");
$op = 'list'; $op = 'list';
} elsif ( $op eq 'cud-delete_confirm' ) { } elsif ( $op eq 'delete_confirm' ) {
my $framework = Koha::BiblioFrameworks->find($frameworkcode); my $framework = Koha::BiblioFrameworks->find($frameworkcode);
my $count = Koha::Biblios->search( { frameworkcode => $frameworkcode, } )->count; my $count = Koha::Biblios->search( { frameworkcode => $frameworkcode, } )->count;