Bug 14899: Add the mapping configuration page in the admin module
[srvgit] / admin / marc_subfields_structure.pl
index 096b9ec..38e6f24 100755 (executable)
@@ -77,7 +77,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         debug           => 1,
     }
 );
-my $cache = Koha::Cache->get_instance();
+my $cache = Koha::Caches->get_instance();
 
 my $op       = $input->param('op') || "";
 $tagfield =~ s/\,//g;
@@ -285,7 +285,8 @@ elsif ( $op eq 'add_validate' ) {
         my $maxlength = $maxlength[$i] ? $maxlength[$i] : 9999;
         
         if (defined($liblibrarian) && $liblibrarian ne "") {
-            unless ( C4::Context->config('demo') or C4::Context->config('demo') eq 1 ) {
+            my $is_demo = C4::Context->config('demo') || '';
+            if ( $is_demo ne '1' ) {
                 if (marc_subfield_structure_exists($tagfield, $tagsubfield, $frameworkcode)) {
                     $sth_update->execute(
                         $tagfield,
@@ -376,7 +377,8 @@ elsif ( $op eq 'delete_confirm' ) {
 }
 elsif ( $op eq 'delete_confirmed' ) {
     my $dbh = C4::Context->dbh;
-    unless ( C4::Context->config('demo') or C4::Context->config('demo') eq 1 ) {
+    my $is_demo = C4::Context->config('demo') || '';
+    if ( $is_demo ne '1' ) {
         my $sth =
           $dbh->prepare(
 "delete from marc_subfield_structure where tagfield=? and tagsubfield=? and frameworkcode=?"