Bugzilla – Attachment 17406 Details for
Bug 9886
ParseLetter removes too often punctuation characters from fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9886: ParseLetter removes too often punctuation characters from fields
Bug-9886-ParseLetter-removes-too-often-punctuation.patch (text/plain), 1.88 KB, created by
Kyle M Hall (khall)
on 2013-04-12 16:47:38 UTC
(
hide
)
Description:
Bug 9886: ParseLetter removes too often punctuation characters from fields
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-04-12 16:47:38 UTC
Size:
1.88 KB
patch
obsolete
>From 44928141808650a30ff52241e388b51e6ee8d1f0 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 21 Mar 2013 13:56:01 +0100 >Subject: [PATCH] Bug 9886: ParseLetter removes too often punctuation characters from fields > >This patch makes ParseLetter somewhat more restrictive in removing >punctuation characters from the end of a table field. >Based on the assumption that we want to remove punctuation from fields in >biblio and biblioitems (like ISBD). >ParseLetter should not remove e.g. a parenthesis in itemcallnumber, but still >removes e.g. a colon (:) at the end of a title. >Removed an unneeded global and lookahead from the regex. > >Test plan: >1) Add a colon (:) to the end of a title. >2) Add a colon to the end of item copynumber. >3) Place a hold on that item. Check it in. Confirm hold. >4) Check the email or print notice generated. There should be no colon at the >end of the title, but the colon in the copynumber should still be there. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Letters.pm | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index fdbb473..b8e2722 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -620,7 +620,11 @@ sub _parseletter { > while ( my ($field, $val) = each %$values ) { > my $replacetablefield = "<<$table.$field>>"; > my $replacefield = "<<$field>>"; >- $val =~ s/\p{P}(?=$)//g if $val; >+ $val =~ s/\p{P}$// if $val && $table=~/biblio/; >+ #BZ 9886: Assuming that we want to eliminate ISBD punctuation here >+ #Therefore adding the test on biblio. This includes biblioitems, >+ #but excludes items. Removed unneeded global and lookahead. >+ > my $replacedby = defined ($val) ? $val : ''; > ($letter->{title} ) and do { > $letter->{title} =~ s/$replacetablefield/$replacedby/g; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9886
:
16959
|
17406
|
17572