Bugzilla – Attachment 147179 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.49 KB, created by
Kyle M Hall (khall)
on 2023-02-22 18:24:08 UTC
(
hide
)
Description:
Bug 33046: Use process_tt in C4::Reports::Guided::EmailReport
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-02-22 18:24:08 UTC
Size:
2.49 KB
patch
obsolete
>From a221f2b8ef1f22ebec9101b7ae5e37249f0410ba 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 >--- > 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