From 3fed05a8dfa36ab0c7da07fde2e6956ce94077b6 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 21 Sep 2023 01:27:45 +0000 Subject: [PATCH] Bug 34859: Remove unnecessary params from reports-home.pl This change removes unnecessary syspref template parameters and tidies the code. Test plan: 0. Apply the patch and koha-plack --reload kohadev 1. Go to /cgi-bin/koha/admin/preferences.pl?op=search&searchfield=IntranetNav 2. Add the following and save:
  • Awesome
  • 3. Go to /cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetstylesheet 4. Add the following and save: http://bad 5. Go to /cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetcolorstylesheet 6. Add the following and save: http://bad2 7. Go to /cgi-bin/koha/reports/reports-home.pl 8. Note the "Awesome" link in the top navbar 9. Note in the console that there are two errors where http://bad and http://bad2 can't be resolved Signed-off-by: Matt Blenkinsop Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 7382e305e1bc6c43c74397f135e2267fcb9f8e4e) Signed-off-by: Fridolin Somers --- reports/reports-home.pl | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/reports/reports-home.pl b/reports/reports-home.pl index 71aaa87e83..dfd36e5f23 100755 --- a/reports/reports-home.pl +++ b/reports/reports-home.pl @@ -17,23 +17,18 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . - use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); -use C4::Context; - my $query = CGI->new; -my ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "reports/reports-home.tt", - query => $query, - type => "intranet", - flagsrequired => {reports => '*'}, - }); -$template->param(intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "reports/reports-home.tt", + query => $query, + type => "intranet", + flagsrequired => { reports => '*' }, + } +); output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5