From 6051eced3027c3adcd42d4326094add838196fd3 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Wed, 12 Jun 2024 19:25:14 -0700 Subject: [PATCH] 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 --- admin/authtypes.pl | 2 +- admin/biblio_framework.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/authtypes.pl b/admin/authtypes.pl index 5445c5b7f0..13f573b300 100755 --- a/admin/authtypes.pl +++ b/admin/authtypes.pl @@ -82,7 +82,7 @@ if ( $op eq 'add_form' ) { } $op = 'list'; -} elsif ( $op eq 'cud-delete_confirm' ) { +} elsif ( $op eq 'delete_confirm' ) { my $authority_type = Koha::Authority::Types->find($authtypecode); my $authorities_using_it = Koha::Authorities->search( { authtypecode => $authtypecode } )->count; $template->param( diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl index 40f5ac83dc..a6f0e10050 100755 --- a/admin/biblio_framework.pl +++ b/admin/biblio_framework.pl @@ -81,7 +81,7 @@ if ( $op eq 'add_form' ) { $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); $op = 'list'; -} elsif ( $op eq 'cud-delete_confirm' ) { +} elsif ( $op eq 'delete_confirm' ) { my $framework = Koha::BiblioFrameworks->find($frameworkcode); my $count = Koha::Biblios->search( { frameworkcode => $frameworkcode, } )->count; -- 2.39.2