Create arrays for empty duplicate properties with sub-properties that have values #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Apologies - this is a continuation of the previous pull request that I accidentally closed)
Issue #32 talks about multiple EVEN elements with no value that have sub-elements with values. The problem can be reproduced with:
Actual Outcome:
It's not possible to tell whether the Census event happened in London or Paris. The same for the Employment event.
Expected Outcome:
The problem appears to happen when there is no value for the EVEN tag. I think that the second instance of the tag doesn't create an array of them as I might expect it to.
The YAML property CollectAsArray looks like it should fix this - but that only works on top level elements like INDI. The property has no effect on sub-elements like EVEN.
If you set the StartWith property to a value like "-" for EVEN it sort of fixes it - but all Events then contain a Value property set to "-" and it only affects that one tag - MARR tags still suffer from the same bug.
To fix this, the pull request submitted introduces a new property to the ParsedLine class called NoValue. If the GEDCOM line doesn't have a value part, then the NoValue flag is set to true and a placeholder value is set on the ParsedLine.
Later, this flag is used to identify the manipulated entries that had no value and remove the placeholder value so that it doesn't appear in the output.
Hi,
This seems to be already be working via the configuration without any code changes.
I'll add this to the default configuration yaml. Can you confirm that this works or do you have further problems?
Hi,
Thanks, your changes work great for the particular example I chose, but aren't generic enough for all tags.
It works for the EVEN tag, but what if the duplicates are for the Marriage
MARR
tag e.g.Or a Divorce
DIV
tag?Or any other tag that supports no value on the actual line and sub-tags?
The benefits of being able to define just one DATE tag in the YAML are lost because you now have to specify them many times under each tag that supports sub-tags.