fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
429 stars 294 forks source link

Generating NAME from GIVN and inflected SURN needs the SEX #4874

Open godzil3 opened 10 months ago

godzil3 commented 10 months ago

When create a person using link Families -> Add a son (or add a brother) autocomplete of name works good

obraz

When create person using link Add a daughter (or add a sister) autocomplete not work at all - name must be typed by editor

obraz

arbor95 commented 10 months ago

you have clicked onto the pencil (edit Name) and then clicked into the given name field. So: no bug. Works as designed.

godzil3 commented 10 months ago

definetly not, i made this step couple times - checked if adding daughter give same result as adding sister recently i created couple women without given name in name thats why i find this out. but i must admit i can't reproduce this error now..

arbor95 commented 10 months ago

so close this issue (i can't reproduce this too)

godzil3 commented 10 months ago

Sorry for way of documentation https://vimeo.com/manage/videos/866543518

Can it be related peron I adding daughter is not approved yet? I observed adding wife with polish surname tradition also not work as expected - I type male surname form -ski and need to correct displayed (using pencil button) surname to female form -ska. I think this can be related somehow

arbor95 commented 10 months ago

So your hint for using polish surname tradition is the key. If then, there is a surname, that is changed to a female form, the edit pencil will not be shown and the name will no longer be extended with given name...

For the additional issue of marriage, by adding the wife, the pencil in the married name disappers and no further change is entered into the married name field.

godzil3 commented 10 months ago

so why when using female form, name is not extended by given name? is that work as designed?

adding wife also sometimes give female form and sometimes i need to click pencil to correct manually, dont know when and why but it's annoying

arbor95 commented 10 months ago

You see, I confirmed your issue. We have to wait, until a developer solves that. Alternate, a pull request can be created by anyone.

godzil3 commented 10 months ago

sorry I misunderstood you. cheers

fisharebest commented 10 months ago

Can you give exact examples. e.g. create a small GEDCOM file where I can see the issue?

arbor95 commented 10 months ago

you can go to dfrese.de, login with Edit PW EditEdit and then https://dfrese.de/tree/ahnen/individual/X5535/Pet-Jablonski#tab-relatives and then create daughter.: You see the missing pencil at the name-tag! direct link: https://dfrese.de/tree/ahnen/add-child-to-family/X5536/F?url=https%3A%2F%2Fdfrese.de%2Ftree%2Fahnen%2Findividual%2FX5535%2FPet-Jablonski%23tab-relatives

If you click to add a wife, you see the missing pencil at "married name" Type. direct link: https://dfrese.de/tree/ahnen/add-spouse-to-individual/X5535?url=https%3A%2F%2Fdfrese.de%2Ftree%2Fahnen%2Findividual%2FX5535%2FPet-Jablonski%23tab-relatives

fisharebest commented 10 months ago

I see the same behaviour in both examples - add wife and add daughter

Screenshot 2023-09-22 at 09 30 33 Screenshot 2023-09-22 at 09 30 26

Where can I see the different behaviour?

arbor95 commented 10 months ago

if you start writing the given name the Name is normally extented by the input.

you see the difference for adding a daughter in this two links: https://dfrese.de/tree/ahnen/add-child-to-family/X2727/F?url=https%3A%2F%2Fdfrese.de%2Ftree%2Fahnen%2Findividual%2FX2724%2FBob-van-Miller%23tab-relatives and https://dfrese.de/tree/ahnen/add-child-to-family/X5536/F?url=https%3A%2F%2Fdfrese.de%2Ftree%2Fahnen%2Findividual%2FX2724%2FBob-van-Miller%23tab-relatives

for add a wife (married name) you can see the difference using the following links: normal behaviour https://dfrese.de/tree/ahnen/add-spouse-to-individual/X2724?url=https%3A%2F%2Fdfrese.de%2Ftree%2Fahnen%2Findividual%2FX2724%2FBob-van-Miller%23tab-relatives buggy behaviour https://dfrese.de/tree/ahnen/add-spouse-to-individual/X5535?url=https%3A%2F%2Fdfrese.de%2Ftree%2Fahnen%2Findividual%2FX5535%2FPet-Jablonski%23tab-relatives

fisharebest commented 10 months ago

There is code to synchronise the NAME field with the GIVN, SURN, etc.

It only works when the name follows a standard pattern.

Here, we have an inflected surname, so that NAME is not the same as GIVN /SURN/.

There is code to handle this case - but it only triggers when SEX = F.

But it can no longer detect the SEX correctly, and so it is not performing the inflection when it creates the NAME.

arbor95 commented 10 months ago

perhaps that is not as complicated, as you write. If we have an inflected surname, so that NAME is not the same as GIVN /SURN/, the inflected surname is created correctly, say /inflectedSURN/ and displayed in the NAME field. If we then enter the GIVN, there has nothing to be changed for the code that adds the letters of the GIVN-input-field.

For me and other outstanding you have to do:
Take letter by letter as entered and display NAME with the /inflectedSURN/ .

Imho the trigger has already be done and no longer needed on input of GIVN. You do not to have to detect the SEX.

fisharebest commented 10 months ago

Synchronising names with inflections requires the SEX.

We only convert -SKI to -SKA for females (and when the language is set to Polish).

But we don't have the SEX. See https://github.com/fisharebest/webtrees/blob/f71a4582d9293d3d97b8d184ace53b195360ebec/resources/views/edit/input-addon-edit-name.phtml#L65

If you change 'U' to 'F' in this file (lines 65 and 82), then the inflexion code works.

arbor95 commented 10 months ago

The sex is the last char of the url before the ? Of query... https://dfrese.de/tree/ahnen/add-child-to-family/X5536/F<----------- ?url=https%3A%2F%2Fdfrese.de%2Ftree%2Fahnen%2Findividual%2FX5535%2FPet-Jablonski%23tab-relatives

By the way: Not the browser must be polish. The setting of Surname tradition is does it. And there are some more endings, not only ...ski.

fisharebest commented 10 months ago

By the way: Not the browser must be polish. The setting of Surname tradition is does it.

The surname tradition creates the default values in NAME and SURN.

The edit control (that synchronises NAME when you edit GIVN and SURN uses different (and much older) logic.

https://github.com/fisharebest/webtrees/blob/f71a4582d9293d3d97b8d184ace53b195360ebec/resources/js/webtrees.js#L103

In webtrees 2.0, all the edit forms were generated by large/complicated blocks of code. These created all the edit controls together.

Since webtrees 2.1, we have a GEDCOM defintion, and the edit controls are created from this definition. Each control is independent. So, the NAME can no longer know the SEX.

The sex is the last char of the url before the ? Of query...

Only when you create a new individual. When you edit a NAME record for an existing individual, the sex is not shown.

arbor95 commented 10 months ago

But the bug, I refer, is in creation of the individual (add a daughter is a creation?). The inflection of the "Name" is created correctly,!!! but when now (for example) the "Given names" is entered, "Name" is not extended accordingly.

This is because the "Name" switches in the 'unautomated' mode, no longer created from its subtags.

fisharebest commented 10 months ago

The name is created correctly (by the surname-tradition code).

But the edit control cannot synchronise the inflected NAME.

Change 'U' to 'F' in the code above (two places), and set the language to Polish. You will then see that it is working.

arbor95 commented 10 months ago

ok, I see.