From: Galen Charlton Date: Fri, 13 Jan 2012 22:13:00 +0000 (-0500) Subject: removing leading and trailing spaces when extracting TCN from 001 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5ff2a014f72f7ccdf906093857c4bfbf36d7b89a;p=working%2FEvergreen.git removing leading and trailing spaces when extracting TCN from 001 Now that the MARC editor is less likely to strip whitespace by accident, make sure that TCN values extracted from the 001 field have leading and trailing whitespace removed. This particularly affects OCLC records, since a record downloaded from OCLC with an eight-digit OCLC number will have a trailing space in the 001. This makes TCNs match the normalization expected by TCN searches. Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm index 6a776d8158..8d6ff48a44 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm @@ -176,6 +176,7 @@ sub _find_tcn_info { my $xpath = '//marc:controlfield[@tag="001"]'; my $tcn = $marcxml->documentElement->findvalue($xpath); + $tcn =~ s/^\s+|\s+$//og; $logger->info("biblio import located 001 (tcn) value of $tcn"); $xpath = '//marc:controlfield[@tag="003"]';