From 0f91ed3010d7a0e571b03fecba3ca07b360c2e82 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Sun, 17 Feb 2008 09:09:31 +1300 Subject: [PATCH] Prevent default framework from being inadvertently deleted. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- admin/biblio_framework.pl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl index c388762795..1f345b70c2 100755 --- a/admin/biblio_framework.pl +++ b/admin/biblio_framework.pl @@ -136,14 +136,17 @@ if ($op eq 'add_form') { } elsif ($op eq 'delete_confirmed') { #start the page and read in includes my $dbh = C4::Context->dbh; - my $frameworkcode=uc($input->param('frameworkcode')); - my $sth=$dbh->prepare("delete from marc_tag_structure where frameworkcode=?"); - $sth->execute($frameworkcode); - $sth=$dbh->prepare("delete from marc_subfield_structure where frameworkcode=?"); - $sth->execute($frameworkcode); - $sth=$dbh->prepare("delete from biblio_framework where frameworkcode=?"); - $sth->execute($frameworkcode); - $sth->finish; +# my $frameworkcode=uc($input->param('frameworkcode')); +# + unless($frameworkcode) { + my $sth=$dbh->prepare("delete from marc_tag_structure where frameworkcode=?"); + $sth->execute($frameworkcode); + $sth=$dbh->prepare("delete from marc_subfield_structure where frameworkcode=?"); + $sth->execute($frameworkcode); + $sth=$dbh->prepare("delete from biblio_framework where frameworkcode=?"); + $sth->execute($frameworkcode); + $sth->finish; + } print "Content-Type: text/html\n\n"; exit; # END $OP eq DELETE_CONFIRMED -- 2.39.5