Bug 28490: Add DBIx schema changes for testing
[koha-ffzg.git] / Koha / AuthorisedValueCategory.pm
index 14eb91d..73f578a 100644 (file)
@@ -20,6 +20,7 @@ use Modern::Perl;
 use Carp;
 
 use Koha::Database;
+use Koha::Exceptions;
 
 use base qw(Koha::Object);
 
@@ -33,6 +34,20 @@ Koha::AuthorisedValueCategory - Koha AuthorisedValueCategory Object class
 
 =cut
 
+=head3 delete
+
+Overridden delete method to prevent system default deletions
+
+=cut
+
+sub delete {
+    my ($self) = @_;
+
+    Koha::Exceptions::CannotDeleteDefault->throw if $self->is_system;
+
+    return $self->SUPER::delete;
+}
+
 =head3 type
 
 =cut