Bugzilla – Attachment 28174 Details for
Bug 11826
Improving code for XSLT handling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11826: QA Follow-up: Enable printing warnings
Bug-11826-QA-Follow-up-Enable-printing-warnings.patch (text/plain), 1.89 KB, created by
Marcel de Rooy
on 2014-05-12 11:02:30 UTC
(
hide
)
Description:
Bug 11826: QA Follow-up: Enable printing warnings
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-05-12 11:02:30 UTC
Size:
1.89 KB
patch
obsolete
>From e754db4b53d59d29dc3cc734fe2c0073d0192ea2 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 12 May 2014 12:47:01 +0200 >Subject: [PATCH] Bug 11826: QA Follow-up: Enable printing warnings >Content-Type: text/plain; charset=utf-8 > >Conform former (implicit) behavior the handler now prints warnings by >default (via STDERR to logfile). >This can be adjusted by: $engine->print_warns(0); > >Test plan: >Generate some error on a XSLT file (e.g. wrong path). >Check if your log contains the associated error(s)/warning(s). >--- > Koha/XSLT_Handler.pm | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > >diff --git a/Koha/XSLT_Handler.pm b/Koha/XSLT_Handler.pm >index c406bdf..f67e8ba 100644 >--- a/Koha/XSLT_Handler.pm >+++ b/Koha/XSLT_Handler.pm >@@ -67,6 +67,10 @@ Koha::XSLT_Handler - Facilitate use of XSLT transformations > If true, transform returns undef on failure. By default, it returns the > original string passed. Errors are reported as described. > >+=head2 print_warns >+ >+ If set, print error messages to STDERR. True by default. >+ > =head1 ERROR CODES > > =head2 Error 1 >@@ -120,7 +124,7 @@ use XML::LibXSLT; > use base qw(Class::Accessor); > > __PACKAGE__->mk_ro_accessors(qw( err errstr )); >-__PACKAGE__->mk_accessors(qw( do_not_return_source )); >+__PACKAGE__->mk_accessors(qw( do_not_return_source print_warns )); > > =head2 transform > >@@ -229,6 +233,7 @@ sub _init { > > $self->_set_error; > $self->{xslt_hash}={}; >+ $self->{print_warns}=1 unless exists $self->{print_warns}; > $self->{do_not_return_source}=0 unless exists $self->{do_not_return_source}; > #by default we return source on a failing transformation > #but it could be passed at construction time already >@@ -303,6 +308,8 @@ sub _set_error { > if( $addmsg ) { > $self->{errstr}.= " $addmsg"; > } >+ >+ warn $self->{errstr} if $self->{print_warns}; > return; > } > >-- >1.7.7.6
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 11826
:
25573
|
25574
|
27229
|
27230
|
27869
|
27870
|
27871
|
27872
|
28093
|
28094
|
28095
|
28096
| 28174