Bug 3150: (QA follow-up) Don't load unused and deleted tt files
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 14 Mar 2023 17:01:50 +0000 (17:01 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Mar 2023 10:49:46 +0000 (12:49 +0200)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
opac/opac-sendshelf.pl
virtualshelves/sendshelf.pl

index 758a32c..bc15fa5 100755 (executable)
@@ -60,15 +60,6 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) {
   if ( $email ) {
     my $comment    = $query->param('comment');
 
-    my ( $template2, $borrowernumber, $cookie ) = get_template_and_user(
-        {
-            template_name   => "opac-sendshelf.tt",
-            query           => $query,
-            type            => "opac",
-            authnotrequired => 1,
-        }
-    );
-
     my $patron = Koha::Patrons->find( $borrowernumber );
     my $user_email = $patron->first_valid_email_address;
     my $shelf = Koha::Virtualshelves->find( $shelfid );
index 032c9fd..c5abdbe 100755 (executable)
@@ -40,7 +40,7 @@ use Koha::Virtualshelves;
 
 my $query = CGI->new;
 
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     {
         template_name   => "virtualshelves/sendshelfform.tt",
         query           => $query,
@@ -55,20 +55,11 @@ my $to_address = $query->param('email');
 my $shelf = Koha::Virtualshelves->find( $shelfid );
 
 output_and_exit( $query, $cookie, $template, 'insufficient_permission' )
-    if $shelf && !$shelf->can_be_viewed( $loggedinuser );
+    if $shelf && !$shelf->can_be_viewed( $borrowernumber );
 
 if ($to_address) {
     my $comment = $query->param('comment');
 
-    my ( $template2, $borrowernumber, $cookie ) = get_template_and_user(
-        {
-        template_name   => "virtualshelves/sendshelf.tt",
-        query           => $query,
-        type            => "intranet",
-        flagsrequired   => { catalogue => 1 },
-        }
-    );
-
     my $patron = Koha::Patrons->find( $borrowernumber );
     my $user_email = $patron->first_valid_email_address;
     my $contents = $shelf->get_contents;