Bugzilla – Attachment 170194 Details for
Bug 36171
Extraction of Template Toolkit directive as translatable string causes patron view error in several languages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36171: Fix template toolkit tags split by HTML parser
0001-Bug-36171-Fix-template-toolkit-tags-split-by-HTML-pa.patch (text/plain), 1.33 KB, created by
Kevin Carnes
on 2024-08-09 13:58:11 UTC
(
hide
)
Description:
Bug 36171: Fix template toolkit tags split by HTML parser
Filename:
MIME Type:
Creator:
Kevin Carnes
Created:
2024-08-09 13:58:11 UTC
Size:
1.33 KB
patch
obsolete
>From ee7d6249e2048c6f680dae5fe13a4b0372e3ff01 Mon Sep 17 00:00:00 2001 >From: Kevin Carnes <kevin.carnes@ub.lu.se> >Date: Fri, 9 Aug 2024 15:52:31 +0200 >Subject: [PATCH] Bug 36171: Fix template toolkit tags split by HTML parser > >--- > C4/TTParser.pm | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/C4/TTParser.pm b/C4/TTParser.pm >index 7007fb6604..c4e2aa8a4e 100644 >--- a/C4/TTParser.pm >+++ b/C4/TTParser.pm >@@ -73,6 +73,22 @@ sub text{ > my $line = shift; > my $work = shift; # original text > my $is_cdata = shift; >+ # If there is a split template toolkit tag >+ if( $work =~ m/.*?%\]/s && index($&, '[%') == -1 ) { >+ my @strings = ($&); >+ my $token; >+ $work = $'; >+ while($token = pop @tokens){ >+ if ( $token->string =~ m/\[%.*?$/s ) { >+ push @tokens, C4::TmplToken->new( $`, $token->type, $token->line_number, $token->pathname ); >+ push @strings, $&; >+ last; >+ } else { >+ push @strings, $token->string; >+ } >+ } >+ push @tokens, C4::TmplToken->new( join('', reverse @strings), C4::TmplTokenType::DIRECTIVE, $token ? $token->line_number : $line, $self->{filename} ); >+ } > while($work){ > # if there is a template_toolkit tag > if( $work =~ m/\[%.*?%\]/ ){ >-- >2.34.1 >
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 36171
:
162490
|
162516
|
165506
|
170194
|
170195
|
170227
|
170262
|
170342
|
172327
|
172334
|
173252