Bug 24094: Strip trailing spaces and punctuation from authority headings
authorNick Clemens <nick@bywatersolutions.com>
Fri, 31 Jan 2020 14:18:24 +0000 (14:18 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 18 Mar 2020 21:54:03 +0000 (21:54 +0000)
commitcf9cedc730934603ab76f8049ccf7ac0581e9556
tree8b47af1748de9b82c430b327bbaee324fe64df03
parent51c01cb843d9a64e09a87f293ccd8fe62794974f
Bug 24094: Strip trailing spaces and punctuation from authority headings

Both when searching for and creating new authorities we need to remove
punctuation that exists in the bibliographic record but does not belong in
the authority record.

For example, a series with a volume contains a semicolon in the bib record,
however, this should not be passed to the authority as the volume is not
included in the authority record.

To test:
 1 - Set AutoCreateAuthorities to 'generate'
 2 - Set BiblioAddsAuthorities to 'true'
 3 - Set CatalogModuleRelink to 'Do'
 4 - Find or create a record with:
    a 100 field with a subfield e preceded by a comma: 100 $aBoring, M. Eugene M ,$e author
    an 830 field with a volume preceded by a semicolon: 650$aLord of the rings ;$v 3.
 5 - Save the records and check the links
 6 - Note punctuation is passed through
 7 - Save again, auth records are created again
 8 - Apply patch
 9 - Save again, new auth records are created again
10 - Check the records, punctuation has been removed
11 - Save again, no more records created.

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 4dd2445fd667294b9cf430f7a6986ea3ceb1cc05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Biblio.pm
C4/Heading/MARC21.pm