[open-ils-commits] [GIT] Evergreen ILS branch rel_2_8 updated. a97830d71ee66f26e958d10fddf035ff66978986
Evergreen Git
git at git.evergreen-ils.org
Fri Oct 2 13:58:33 EDT 2015
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, rel_2_8 has been updated
via a97830d71ee66f26e958d10fddf035ff66978986 (commit)
from e38f089bb54397c6465b9c12bf2c4c0d3ac12a39 (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 a97830d71ee66f26e958d10fddf035ff66978986
Author: Jason Stephenson <jstephenson at mvlc.org>
Date: Fri Oct 2 10:17:09 2015 -0400
LP 1502156: Fix marc_export error when dumping authorities.
There is a chance that marc_export will attempt to call a nonexistent
field on MARC::Record if an error occurs while exporting authority
records. The bug could only be triggered if a conversion error
occurred while exporting the authority as either MARCXML or USMARC.
The fix is to rename a couple of variables in the Marque::Authority->next
method to be more like those used in Marque::Biblio->next. This will have
the side effect of making marc_export easier to maintain, since the
variables used in one method will now have the same meaning as those
in the other.
Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/support-scripts/marc_export.in b/Open-ILS/src/support-scripts/marc_export.in
index 348c4b3..70a659f 100755
--- a/Open-ILS/src/support-scripts/marc_export.in
+++ b/Open-ILS/src/support-scripts/marc_export.in
@@ -724,53 +724,53 @@ sub next {
if ($data) {
my $format = $Marque::config->option_value('format');
- my $are = $self->{fmClass}->from_bare_hash($data);
+ my $r = $self->{fmClass}->from_bare_hash($data);
if ($format eq 'ARE') {
- $output = OpenSRF::Utils::JSON->perl2JSON($are);
+ $output = OpenSRF::Utils::JSON->perl2JSON($r);
} else {
- my $r;
+ my $marc;
eval {
- $r = MARC::Record->new_from_xml($are->marc(),
+ $marc = MARC::Record->new_from_xml($r->marc(),
$Marque::config->option_value('encoding'),
$Marque::config->option_value('format'));
};
if ($@) {
- print STDERR "Error in authority record " . $are->id() . "\n";
+ print STDERR "Error in authority record " . $r->id() . "\n";
print STDERR "$@\n";
import MARC::File::XML; # Reset SAX Parser.
return $self->next();
}
if ($Marque::config->option_value('replace_001')) {
- my $tcn = $r->field('001');
+ my $tcn = $marc->field('001');
if ($tcn) {
- $tcn->update($are->id());
+ $tcn->update($r->id());
} else {
- $tcn = MARC::Field->new('001', $are->id());
- $r->insert_fields_ordered($tcn);
+ $tcn = MARC::Field->new('001', $r->id());
+ $marc->insert_fields_ordered($tcn);
}
}
if ($Marque::config->option_value('since')) {
- my $leader = $r->leader();
- if ($U->is_true($are->deleted())) {
+ my $leader = $marc->leader();
+ if ($U->is_true($r->deleted())) {
substr($leader, 5, 1) = 'd';
- $r->leader($leader);
+ $marc->leader($leader);
} else {
my $create_date = Date::Manip::Date->new;
- $create_date->parse($are->create_date());
+ $create_date->parse($r->create_date());
my $edit_date = Date::Manip::Date->new;
- $edit_date->parse($are->edit_date());
+ $edit_date->parse($r->edit_date());
if ($self->{since_date}->cmp($create_date) < 0) {
substr($leader, 5, 1) = 'n';
- $r->leader($leader);
+ $marc->leader($leader);
} elsif ($self->{since_date}->cmp($edit_date) < 0) {
substr($leader, 5, 1) = 'c';
- $r->leader($leader);
+ $marc->leader($leader);
}
}
}
if ($Marque::config->option_value('format') eq 'XML') {
eval {
- $output = $r->as_xml_record;
+ $output = $marc->as_xml_record;
$output =~ s/^<\?.+?\?>$//mo;
};
if ($@) {
@@ -780,7 +780,7 @@ sub next {
}
} else {
eval {
- $output = $r->as_usmarc;
+ $output = $marc->as_usmarc;
};
if ($@) {
print STDERR "Error in authority record " . $r->id() . "\n";
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/support-scripts/marc_export.in | 36 +++++++++++++-------------
1 files changed, 18 insertions(+), 18 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list