Bugzilla – Attachment 150494 Details for
Bug 33046
Use process_tt in C4::Reports::Guided::EmailReport
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33046: Use process_tt in C4::Reports::Guided::EmailReport
Bug-33046-Use-processtt-in-C4ReportsGuidedEmailRep.patch (text/plain), 2.54 KB, created by
David Nind
on 2023-05-02 02:34:41 UTC
(
hide
)
Description:
Bug 33046: Use process_tt in C4::Reports::Guided::EmailReport
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-05-02 02:34:41 UTC
Size:
2.54 KB
patch
obsolete
>From 74aa20a3d05b6d3f1114261445fe4d9b36274785 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Wed, 22 Feb 2023 13:23:09 -0500 >Subject: [PATCH] Bug 33046: Use process_tt in C4::Reports::Guided::EmailReport > >Bug 33030 implements a new helper subroutine to standardize processing of Template Toolkit syntax outside slips and notices. We should use this subroutine in EmailReport. > >Test Plan: >1) Apply this patch >2) prove t/db_dependent/Reports/Guided.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Reports/Guided.pm | 41 +++++++++-------------------------------- > 1 file changed, 9 insertions(+), 32 deletions(-) > >diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm >index cbbc1a6f88..a55cd17743 100644 >--- a/C4/Reports/Guided.pm >+++ b/C4/Reports/Guided.pm >@@ -23,20 +23,20 @@ use Carp qw( carp croak ); > use JSON qw( from_json ); > > use C4::Context; >-use C4::Templates qw/themelanguage/; > use C4::Koha qw( GetAuthorisedValues ); >-use Koha::DateUtils qw( dt_from_string ); >-use Koha::Patrons; >-use Koha::Reports; >-use C4::Output; > use C4::Log qw( logaction ); >-use Koha::Notice::Templates; >- >+use C4::Output; >+use C4::Templates qw/themelanguage/; >+use Koha::AuthorisedValues; > use Koha::Database::Columns; >+use Koha::DateUtils qw( dt_from_string ); > use Koha::Logger; >-use Koha::AuthorisedValues; >+use Koha::Notice::Templates; > use Koha::Patron::Categories; >+use Koha::Patrons; >+use Koha::Reports; > use Koha::SharedContent; >+use Koha::TemplateUtils qw( process_tt ); > > our (@ISA, @EXPORT_OK); > BEGIN { >@@ -1061,7 +1061,7 @@ sub EmailReport { > > my $from_address = $from || $row->{from}; > my $to_address = $row->{$email_col}; >- push ( @errors, { NOT_PARSE => $counter } ) unless my $content = _process_row_TT( $row, $template ); >+ push ( @errors, { NOT_PARSE => $counter } ) unless my $content = process_tt( $template, $row ); > $counter++; > next if scalar @errors > $err_count; #If any problems, try next > >@@ -1078,29 +1078,6 @@ sub EmailReport { > > } > >- >- >-=head2 ProcessRowTT >- >- my $content = ProcessRowTT($row_hashref, $template); >- >-Accepts a hashref containing values and processes them against Template Toolkit >-to produce content >- >-=cut >- >-sub _process_row_TT { >- >- my ($row, $template) = @_; >- >- return 0 unless ($row && $template); >- my $content; >- my $processor = Template->new(); >- $processor->process( \$template, $row, \$content); >- return $content; >- >-} >- > sub _get_display_value { > my ( $original_value, $column ) = @_; > if ( $column eq 'periodicity' ) { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33046
:
147179
|
150494
|
153148