-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple SG2 segments not allowed #130
Comments
You are right.. |
@szocsbarni I pushed a commit which should deal with this case, can you test with a larger sample? Thanks :) |
@sabas the fix is ok, parsing does not stop on the double
|
On the same file? Strange.. require('vendor/autoload.php');
$c = new EDI\Parser();
$file = <<<END
UNA:+.?'
UNB+UNOC:3+0000000000000:14+0000000000000:14+231126:1830+502+0000++++PRICAT'
UNH+1+PRICAT:D:01B:UN:EAN009'
BGM+9:::PREISLISTE+11+4'
DTM+137:20231126:102'
NAD+BY+1111111111111::9'
NAD+SU+2222222222222::9'
UNT+0+1'
UNZ+1+502'
END;
$c->loadString($file);
$o = $c->get();
d($o);
d($c->errors());
$mapping = new EDI\Mapping\MappingProvider($c->getMessageDirectory());
$analyser = new EDI\Analyser();
$segs = $analyser->loadSegmentsXml($mapping->getSegments());
$svc = $analyser->loadSegmentsXml($mapping->getServiceSegments(3));
$interpreter = new EDI\Interpreter($mapping->getMessage($c->getMessageFormat()), $segs, $svc);
//$interpreter->togglePatching(false);
$prep = $interpreter->prepare($o);
d($prep);
d($interpreter->getErrors()); |
yes, even running this concrete code segment of yours (replaced function calls of
|
Can I help you anything with this issue? @sabas |
With the commit dffa093 in the test case you provided it seemed fixed. |
yes, that commit indeed solves it, my fault, sorry! |
Given the below, short edi content,
D01B
version,pricat
type:the current code version on the master (d4c8450) skips the 2nd
NAD
command with the below warning:while the release v1 (2949865), parses them, without any warnings. According to the PRICAT documentation, there can be multiple
SG2
segments, each of them containing oneNAD
command.The text was updated successfully, but these errors were encountered: