[OpenSRF-GIT] OpenSRF branch master updated. e72473d9c43a579ea64cb79fd410d37df23c3445
Evergreen Git
git at git.evergreen-ils.org
Mon May 7 15:39:13 EDT 2018
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 "OpenSRF".
The branch, master has been updated
via e72473d9c43a579ea64cb79fd410d37df23c3445 (commit)
from f8dfa10b7613799190524ae1bf635d6c90a97b98 (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 e72473d9c43a579ea64cb79fd410d37df23c3445
Author: Jason Stephenson <jason at sigio.com>
Date: Sun Feb 18 12:12:13 2018 -0500
LP1340982: Ignore both 'comment' and '#comment' nodes in Settings Parse.
Modify the XML2perl helper function in OpenSRF::Utils::SettingsParser
to ignore comment nodes that have names of comment and #comment.
To reproduce the bug:
1. Stop OpenSRF services.
2. Add a XML comment, any text betwen <!-- and -->, in the list of
MARC templates in the opensrf.xml file.
3. Restart OpenSRF services.
4. In the staff client, go to Cataloging->Create New MARC Record.
5. In the list of templates, you will #comment where you added the
comment. (NOTE: I only tested with 1 comment. Things may get worse
with more than 1 comment.)
6. There will be an error like the following in the
open-ils.cat_stderr.log if you attempt to choose the #comment entry:
Caught error from 'run' method: Exception: OpenSRF::EX::ERROR
2018-02-18T11:24:30 OpenSRF::Application
/usr/local/share/perl/5.22.1/OpenSRF/Application.pm:240 System
ERROR: Unable to open MARC template file: HASH(0x2249928) :
To test the fix:
1. Leave the comments in the opensrf.xml file from before.
2. Apply this commit, do make and make install for OpenSRF.
3. Just to make sure, do make and make install for Evergreen.
4. Repeat steps 3 and 4 from above.
5. You should NOT see any templates named #comment.
Signed-off-by: Jason Stephenson <jason at sigio.com>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
diff --git a/src/perl/lib/OpenSRF/Utils/SettingsParser.pm b/src/perl/lib/OpenSRF/Utils/SettingsParser.pm
index 8d5e5fe..6b84572 100644
--- a/src/perl/lib/OpenSRF/Utils/SettingsParser.pm
+++ b/src/perl/lib/OpenSRF/Utils/SettingsParser.pm
@@ -126,7 +126,7 @@ sub XML2perl {
return _check_for_int($kids[0]->textContent);
} else {
for my $kid ( @kids ) {
- next if ($kid->nodeName eq 'comment');
+ next if ($kid->nodeName =~ /^#?comment$/);
if (exists $output{$kid->nodeName}) {
if (ref $output{$kid->nodeName} ne 'ARRAY') {
$output{$kid->nodeName} = [$output{$kid->nodeName}, XML2perl($kid)];
-----------------------------------------------------------------------
Summary of changes:
src/perl/lib/OpenSRF/Utils/SettingsParser.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
OpenSRF
More information about the opensrf-commits
mailing list