Neriderc / GVExport

Repository for GVExport module for Webtrees
GNU General Public License v2.0
15 stars 6 forks source link

Error in name label #212

Closed hartenthaler closed 1 year ago

hartenthaler commented 2 years ago

In the latest code of main there is an error (in decorated and combined mode): Screenshot (269)

In simple mode you can see that the wife has two NAME records (btw: the HTML code should not be visible.): Screenshot (268)

Neriderc commented 1 year ago

Is it some specific combination of settings? I haven't been able to reproduce this.

Could you try resetting the settings and see if this fixes it?

I don't even see the HTML tags that you see. I do notice that only one of your records has this, the other appears fine. If you try to generate a tree without this person in it, does it work?

hartenthaler commented 1 year ago

It doesn't depend on the setting of options. Resetting options doesn't help. Using Firefox instead of Edge doesn't help.

Can you see it at https://ahnen.hartenthaler.eu/module/_GVExport_/Chart/ahnen?xref=I43770 ?

I saw it two times: in both cases, there are two birth name records: one in Latin and one in Greek characters. If those two persons are not in the displayed tree, everything is ok.

Neriderc commented 1 year ago

I have managed to work out the issue. It was specifically the code that adds an alternate name. From what I understand, an alternate name is a name that is not a primary name and is in a different script to the primary name. I didn't have anyone like this in my tree so didn't see the issue. After adding this to my test tree I could see the issue.

The alternate name was added separately in the code and didn't go through the same formatting process as the primary name. I hadn't touched it until this point. To be honest I don't understand why it worked in 2.1.11 but doesn't work in main now, since the code around retrieving the name and adding to the diagram hasn't changed (but I have confirmed it works in 2.1.11). However, I have resolved the issue by feeding the name into the same name formatting function as the primary name (though it will not be affected by the setting to abbreviate the name - except disabling names which I specifically addressed - because webtrees doesn't feed in an array of the name parts for the alternate name).

Neriderc commented 1 year ago

Just having a look at the webtrees code, it looks like the alternate name function returns the "full" name of the "secondary" name. In theory we can switch to using the getSecondaryName function and this would make it easy to do all the name abbreviations on the alternate name. Is there any reason not to apply the abbreviations to the alternate name?

hartenthaler commented 1 year ago

No. Thank you!

Neriderc commented 1 year ago

I've merged in a change to abbreviate the secondary name when abbreviating the primary name.

I ran into trouble with initials, so alternate/secondary name is not shown when one of the settings with initials is selected.