Bug 20639: (follow-up) Fix population of backends
[koha.git] / opac / unapi
index b608210..fb5ce0f 100755 (executable)
@@ -17,8 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-use warnings;
+use Modern::Perl;
 
 =head1 NAME
 
@@ -130,23 +129,23 @@ if (not defined $format) {
 
         my $content;
 
-            my $marcxml = GetXmlBiblio($biblionumber);
-            unless (defined $marcxml) {
-                # no bib, so 404
-                print $cgi->header( -status => '404 record not found');
-                exit 0;
-            }
-
-            my $xslt_file = get_xslt_file( $format, $format_to_stylesheet_map, $format_info );
-            unless( defined $xslt_file ) {
-                print $cgi->header( -status => '406 invalid format requested' );
-                exit 0;
-            }
-            my $xslt_engine = Koha::XSLT_Handler->new;
-            $content = $xslt_engine->transform({
-                xml => $marcxml,
-                file => $xslt_file,
-            });
+        my $marcxml = GetXmlBiblio($biblionumber);
+        unless (defined $marcxml) {
+            # no bib, so 404
+            print $cgi->header( -status => '404 record not found');
+            exit 0;
+        }
+
+        my $xslt_file = get_xslt_file( $format, $format_to_stylesheet_map, $format_info );
+        unless( defined $xslt_file ) {
+            print $cgi->header( -status => '406 invalid format requested' );
+            exit 0;
+        }
+        my $xslt_engine = Koha::XSLT_Handler->new;
+        $content = $xslt_engine->transform({
+            xml => $marcxml,
+            file => $xslt_file,
+        });
 
         if( !defined $content || $xslt_engine->err ) {
             print $cgi->header( -status => '500 internal error' );