Dec 7, 2009 at 5:58 PM
Edited Dec 7, 2009 at 6:01 PM
I've got my family tree exported from genesreunited.co.uk, but lots of people are missing the relationship between the children and thier mother - i.e. only the father is shown.
It looks like the code in GedcomImport.ImportFamilies only adds the relationship details to the husband, if present. If the husband is not present then the children info is added to the wife.
This doesn't work if there is no marriage info between the husband and wife - the info is added to the husband, and as the husband is not-null then the child info is not added to the wife.
I originally fixed this by changing
if (husbandPerson == null && wifePerson != null & childPerson != null)
RelationshipHelper.AddChild(people, wifePerson, childPerson);
if ((husbandPerson == null || husbandPerson.GetSpouseRelationship(wifePerson) == null)
&& wifePerson != null & childPerson != null)
- that means that the links between the children and their mothers in the tree now show up.
However, the marriage link is missing.
The real problem is that genesreunited is writing out the family info out to the GEDCOM:
0 @F517@ FAM
1 HUSB @I1839@
1 WIFE @I1837@
1 CHIL @I1841@
1 CHIL @I1842@
1 CHIL @I1840@
but ImportMarriage is failing as genesreunited doesn't write out a MARR tag as there are no details entered (it's dead easy to create a marriage in genesreunited without bothering to enter any of the marriage details).
As we know about the marriage from the FAM tag we should instead fix up the marriage. I changed GedcomImport.ImportMarriage to be:
DateTime? marriageDate = null;
DateTime? divorceDate = null;
SpouseModifier modifier = SpouseModifier.Current;
// See if a marriage (or divorce) is specified.
if (node.SelectSingleNode("MARR") != null || node.SelectSingleNode("DIV") != null)
// Get dates.
marriageDate = GetValueDate(node, "MARR/DATE");
divorceDate = GetValueDate(node, "DIV/DATE");
modifier = GetDivorced(node) ? SpouseModifier.Former : SpouseModifier.Current;
// Add info to husband.
if (husband.GetSpouseRelationship(wife) == null)
SpouseRelationship husbandMarriage = new SpouseRelationship(wife, modifier);
husbandMarriage.MarriageDate = marriageDate;
husbandMarriage.DivorceDate = divorceDate;
// Add info to wife.
if (wife.GetSpouseRelationship(husband) == null)
SpouseRelationship wifeMarriage = new SpouseRelationship(husband, modifier);
wifeMarriage.MarriageDate = marriageDate;
wifeMarriage.DivorceDate = divorceDate;
And this fixes the missing relationships from my tree. Will this (or a variation on this) make it into the next release?
Also, as an aside, there don't seem to be many checkins to this project - what's the deal if I wanted to contribute?