[open-ils-commits] [GIT] Evergreen ILS branch master updated. 6bc0bc2fb3f405ad4609a9be2992374c57bf0328

Evergreen Git git at git.evergreen-ils.org
Mon Aug 29 17:28:26 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  6bc0bc2fb3f405ad4609a9be2992374c57bf0328 (commit)
      from  e07ac6c32679a87ecf2dcc5c4c11a01347871313 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6bc0bc2fb3f405ad4609a9be2992374c57bf0328
Author: Jeff Godin <jgodin at tadl.org>
Date:   Mon Aug 29 12:58:27 2016 -0400

    LP#1618136 Fix webstaff IDL2js.js test failures
    
    Fix webstaff test failures due to an invalid IDL2js.js file by adding
    newly-required preprocessing to the support script that generates that
    file when running tests.
    
    Signed-off-by: Jeff Godin <jgodin at tadl.org>
    Signed-off-by: Ben Shum <ben at evergreener.net>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/web/js/ui/default/staff/test/data/idl2js.pl b/Open-ILS/web/js/ui/default/staff/test/data/idl2js.pl
index 66fb2e1..4301f31 100644
--- a/Open-ILS/web/js/ui/default/staff/test/data/idl2js.pl
+++ b/Open-ILS/web/js/ui/default/staff/test/data/idl2js.pl
@@ -9,7 +9,8 @@ my $xsl_file = '../../../../../../../xsl/fm_IDL2js.xsl';
 my $xslt = XML::LibXSLT->new();
 my $style_doc = XML::LibXML->load_xml(location => $xsl_file, no_cdata=>1);
 my $stylesheet = $xslt->parse_stylesheet($style_doc);
-my $idl_doc = XML::LibXML->load_xml(location => $idl_file);
+my $idl_string = preprocess_idl_file($idl_file);
+my $idl_doc = XML::LibXML->load_xml(string => $idl_string);
 my $results = $stylesheet->transform($idl_doc);
 my $output = $stylesheet->output_as_bytes($results);
 
@@ -20,3 +21,16 @@ print IDL $output;
 close(IDL);
 
 
+sub preprocess_idl_file {
+       my $file = shift;
+       open my $idl_fh, '<', $file or die "Unable to open IDL file $file : $!\n";
+       local $/ = undef;
+       my $xml = <$idl_fh>;
+       close($idl_fh);
+       # These substitutions are taken from OpenILS::WWW::IDL2js
+       $xml =~ s/<!--.*?-->//sg;     # filter out XML comments ...
+       $xml =~ s/(?:^|\s+)--.*$//mg; # and SQL comments ...
+       $xml =~ s/^\s+/ /mg;          # and extra leading spaces ...
+       $xml =~ s/\R*//g;             # and newlines
+       return $xml;
+}

-----------------------------------------------------------------------

Summary of changes:
 .../web/js/ui/default/staff/test/data/idl2js.pl    |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list