Bug 23251 - EDI Order line incorrectly terminated when it ends with a quoted apostrophe
Summary: EDI Order line incorrectly terminated when it ends with a quoted apostrophe
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Colin Campbell
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-02 09:48 UTC by Colin Campbell
Modified: 2019-09-03 21:30 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03


Attachments
Patch and test (2.01 KB, patch)
2019-07-02 15:14 UTC, Colin Campbell
Details | Diff | Splinter Review
Bug 23251 Correct formatting of IMD data ending in apostrophe (2.07 KB, patch)
2019-07-25 23:08 UTC, Hayley Mapley
Details | Diff | Splinter Review
Bug 23251: Correct formatting of IMD data ending in apostrophe (2.07 KB, patch)
2019-07-25 23:12 UTC, Hayley Mapley
Details | Diff | Splinter Review
Bug 23251: Correct formatting of IMD data ending in apostrophe (2.14 KB, patch)
2019-07-26 14:51 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Campbell 2019-07-02 09:48:56 UTC
Apostrophe is used to terminate segments in Edifact orders. Therefore if appearing in the data it is quoted - Code should not assume that a quoted apostrophe is a valid segment terminator

e.g.
LIN+4++9781471186684:EN'
IMD+L+009+:::Newton-John, Olivia'
IMD+L+050+:::Don?'t stop believin?'
IMD+L+109+:::Simon & Schuster'
QTY+21:1'
GIR+001+001:LFN+CRO:LLO+BAH:LST+920 NEW:LSM'
PRI+AAE:20.00:CA'
RFF+LI:93323'
RFF+QLI:OTM88093/00004'
  
The IMD 050 line is incorrectly formed it should end believin?''
Comment 1 Colin Campbell 2019-07-02 15:14:42 UTC
Created attachment 91188 [details] [review]
Patch and test

To test apply the patch and tests should still pass including new test for correct behaviour when data ends with apostrophe
Comment 2 Hayley Mapley 2019-07-25 23:08:18 UTC
Created attachment 91782 [details] [review]
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>
Comment 3 Hayley Mapley 2019-07-25 23:12:50 UTC
Created attachment 91783 [details] [review]
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>
Comment 4 Hayley Mapley 2019-07-25 23:13:21 UTC
Hi Colin,

I've signed off the patch, but have a look here at the guidelines for patches:
https://wiki.koha-community.org/wiki/Commit_messages#Good_commit_messages

Namely, the commit message and the Bugzilla message should be the same, and the patch message should contain Bug XXXX: in the subject heading.

Thanks for contributing! And do let me know if you have any questions about the above :)
Comment 5 Kyle M Hall 2019-07-26 14:51:57 UTC
Created attachment 91814 [details] [review]
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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Martin Renvoize 2019-07-26 15:19:28 UTC
Nice work!

Pushed to master for 19.11.00
Comment 7 Fridolin SOMERS 2019-08-09 12:55:06 UTC
Pushed to 19.05.x for 19.05.03
Comment 8 Lucas Gass 2019-09-03 21:29:45 UTC
backported to 18.11.x for 18.11.10