Bugzilla – Attachment 184000 Details for
Bug 20253
Optionally use buyer's purchase order number from EDIFACT quote in basket name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20253: Remove warnings from EDI when running tests
Bug-20253-Remove-warnings-from-EDI-when-running-te.patch (text/plain), 1.50 KB, created by
Martin Renvoize (ashimema)
on 2025-07-11 15:36:13 UTC
(
hide
)
Description:
Bug 20253: Remove warnings from EDI when running tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-07-11 15:36:13 UTC
Size:
1.50 KB
patch
obsolete
>From f2a7324a6defa73123f7d6c3419bfd0c83c22d47 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Thu, 10 Jul 2025 16:52:41 +0100 >Subject: [PATCH] Bug 20253: Remove warnings from EDI when running tests > >--- > Koha/Edifact.pm | 2 +- > Koha/Edifact/Segment.pm | 7 +++++++ > 2 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/Koha/Edifact.pm b/Koha/Edifact.pm >index 7479a9b42b5..ada773b9ca4 100644 >--- a/Koha/Edifact.pm >+++ b/Koha/Edifact.pm >@@ -36,7 +36,7 @@ my $separator = { > sub new { > my ( $class, $param_hashref ) = @_; > my $transmission; >- my $self = (); >+ my $self = {}; > > if ( $param_hashref->{filename} ) { > if ( $param_hashref->{transmission} ) { >diff --git a/Koha/Edifact/Segment.pm b/Koha/Edifact/Segment.pm >index 563b3e72224..a9600168e0a 100644 >--- a/Koha/Edifact/Segment.pm >+++ b/Koha/Edifact/Segment.pm >@@ -86,6 +86,10 @@ sub as_string { > # parse a string into fields > sub _parse_seg { > my $s = shift; >+ >+ # Handle undefined or empty segments >+ return { tag => '', elem_arr => [] } unless defined $s && length $s >= 3; >+ > my $e = { > tag => substr( $s, 0, 3 ), > elem_arr => _get_elements( substr( $s, 3 ) ), >@@ -100,6 +104,9 @@ sub _parse_seg { > sub _get_elements { > my $seg = shift; > >+ # Handle undefined or empty segments >+ return [] unless defined $seg; >+ > $seg =~ s/^[+]//; # dont start with a dummy element` > my @elem_array = map { _components($_) } split /(?<![?])[+]/, $seg; > >-- >2.50.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 20253
:
183859
|
183860
|
183861
|
183862
|
183953
|
183954
|
183955
|
183956
|
183957
|
183958
| 184000 |
184001
|
184002
|
184003
|
184004
|
184005
|
184006
|
184007
|
185221
|
185222
|
185223
|
185224
|
185225
|
185226
|
185227
|
185228