Bugzilla – Attachment 91782 Details for
Bug 23251
EDI Order line incorrectly terminated when it ends with a quoted apostrophe
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23251 Correct formatting of IMD data ending in apostrophe
Bug-23251-Correct-formatting-of-IMD-data-ending-in.patch (text/plain), 2.07 KB, created by
Hayley Pelham
on 2019-07-25 23:08:18 UTC
(
hide
)
Description:
Bug 23251 Correct formatting of IMD data ending in apostrophe
Filename:
MIME Type:
Creator:
Hayley Pelham
Created:
2019-07-25 23:08:18 UTC
Size:
2.07 KB
patch
obsolete
>From dd7577e5d59000888e2c036ac61e286c942a834f Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Tue, 2 Jul 2019 10:58:41 +0100 >Subject: [PATCH] Bug 23251 Correct formatting of IMD data ending in apostrophe > >IMD text data may end in an apostrophe (e.g. dreamin' ) >This was causing the segment to be incorrectly formatted >as only the last character was checked, not the preceding >character to check whether it was quoted > >add a test for this specific occurence > >Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> >--- > Koha/Edifact/Order.pm | 2 +- > t/Ediorder.t | 13 ++++++++++++- > 2 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/Koha/Edifact/Order.pm b/Koha/Edifact/Order.pm >index 9822526a3b..062a2f930a 100644 >--- a/Koha/Edifact/Order.pm >+++ b/Koha/Edifact/Order.pm >@@ -512,7 +512,7 @@ sub imd_segment { > } > $odd = !$odd; > } >- if ( @segs && $segs[-1] !~ m/$seg_terminator$/o ) { >+ if ( @segs && $segs[-1] !~ m/[^?]$seg_terminator$/o ) { > $segs[-1] .= $seg_terminator; > } > return @segs; >diff --git a/t/Ediorder.t b/t/Ediorder.t >index 50926a9127..ceeb647371 100755 >--- a/t/Ediorder.t >+++ b/t/Ediorder.t >@@ -3,7 +3,7 @@ use strict; > use warnings; > use FindBin qw( $Bin ); > >-use Test::More tests => 8; >+use Test::More tests => 10; > > BEGIN { use_ok('Koha::Edifact::Order') } > >@@ -55,6 +55,17 @@ $data_to_encode .= '??'; > cmp_ok( $segs[1], 'eq', q{IMD+L+010+:::CCCCCCCCCC??'}, > 'IMD segment deals with quoted character at end' ); > >+# special case for text ending in apostrophe e.g. nuthin' >+$data_to_encode .= q{?'}; >+@segs = Koha::Edifact::Order::imd_segment( $code, $data_to_encode ); >+cmp_ok( $segs[1], 'eq', q{IMD+L+010+:::CCCCCCCCCC???''}, >+ 'IMD segment deals with quoted apostrophe at end' ); >+ >+$data_to_encode =~s/\?'$//; >+@segs = Koha::Edifact::Order::imd_segment( $code, $data_to_encode ); >+cmp_ok( $segs[1], 'eq', q{IMD+L+010+:::CCCCCCCCCC??'}, >+ 'IMD segment deals with apostrophe preceded by quoted ? at end' ); >+ > my $isbn = '3540556753'; > my $ean = '9783540556756'; > >-- >2.11.0
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 23251
:
91188
|
91782
|
91783
|
91814