From a426134fe33728d96fef911bc0e937d58f0951cb Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 14 Mar 2023 17:01:50 +0000 Subject: [PATCH] Bug 3150: (QA follow-up) Don't load unused and deleted tt files Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- opac/opac-sendshelf.pl | 9 --------- virtualshelves/sendshelf.pl | 13 ++----------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index 758a32c8db..bc15fa55cc 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -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 ); diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index 032c9fd8a5..c5abdbe555 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -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; -- 2.39.5