Question Identities in gedcom file
- sevtor
- Topic Author
- Offline
- New Member
All new persons, families, sources, ... get an id "X" plus a number, not Innn, Fnnn, Snnn as I had expected. All works fine and
I can import such gedcom files to webtrees 1.7.16.
Question: is this really according to the standard? Does it work to import into other software?
webtrees 2.1.18, php 8.1.27, torstendahl.se/demo/
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
Yes. The standard says that these "XREF"s can be made from any character (except "@").
> Does it work to import into other software?
Yes.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- Andreas
- Offline
- Premium Member
Please tell me the way where I can adjust the old behavior, that the XREFs stay as follows
I=Individual
F=Family
S=Source
M=Media
N=Note
R=Repository
Both MAUPILLÉ & RAUHUT families are using webtrees V2.1.18
Please Log in or Create an account to join the conversation.
- bertkoor
- Away
- Platinum Member
- Greetings from Utrecht, Holland
Change the function getNewXref (line 516) to accept a prefix instead of declaring it as static 'X' (remove line 524) and also keep the function without parameters to call it with 'X':
Then adjust the calls to that function.
- function createFamily: $xref = $this->getNewXref('F');
- function createIndividual: $xref = $this->getNewXref('I');
- function createMediaObject: $xref = $this->getNewXref('M');
It's a start, other object types are created in such a manner that I don't see a quick way to let them get their own prefixes again.
And then there's the function renumberAction in AdminTreesController.php.
There you coud do something like:
stamboom.BertKoor.nl runs on webtrees v1.7.13
Please Log in or Create an account to join the conversation.
- Andreas
- Offline
- Premium Member
Greg proposed to do so in another thread
But without understanding the reason for that Greg removed the speaking XREFs, I fear that this will create more trouble than benefit.
In addition I learned in the past that it's no a good idea to modify code of an application, because on the next release my change file will be erased.
I may prefere to live with the different behavior, but I would like to understand the reason for that the XREF must always start with a "X".
In an other thread I asked why V2.0.x will not have an user-configurable option.
Both MAUPILLÉ & RAUHUT families are using webtrees V2.1.18
Please Log in or Create an account to join the conversation.
- norwegian_sardines
- Offline
- Platinum Member
- Posts: 2993
Please Log in or Create an account to join the conversation.
- Andreas
- Offline
- Premium Member
bertkoor wrote: You can try the following changes in Tree.php
Change the function getNewXref (line 516) to accept a prefix instead of declaring it as static 'X' (remove line 524) and also keep the function without parameters to call it with 'X':
Please don't laugh, but I started coding with FORTRAN 4 and VB.
I'm not used to write php code.
Is it possible to have two functions with the same name, once with and once without parameter ?
And how will I find all occurrences of calls to getNewXref() ?bertkoor wrote: Then adjust the calls to that function.
- function createFamily: $xref = $this->getNewXref('F');
- function createIndividual: $xref = $this->getNewXref('I');
- function createMediaObject: $xref = $this->getNewXref('M');
I'm thinking also about Sources, Notes and Repositories
This only for the case if I would like to use this functionality !!bertkoor wrote: It's a start, other object types are created in such a manner that I don't see a quick way to let them get their own prefixes again.
And then there's the function renumberAction in AdminTreesController.php.
Both MAUPILLÉ & RAUHUT families are using webtrees V2.1.18
Please Log in or Create an account to join the conversation.
- Andreas
- Offline
- Premium Member
norwegian_sardines wrote: Greg gave an explanation HERE.
I read this and it doesn't convince me. I thought it has a real reason, like simplify coding or reduce response time on requests.
It would be better to restrict the starting letter to the letters of the alphabet except I, O and S, to prevent confusion.
When I use an ID to reuse it on another form, then I make a cut&paste and don't copy it with my pencil.
But when merging double individuals, or families I cut the IDs and paste them into the fields of the merging page.
If XREFs of individuals as well as families start both with X I will have problems with merging double records.
Both MAUPILLÉ & RAUHUT families are using webtrees V2.1.18
Please Log in or Create an account to join the conversation.
- bertkoor
- Away
- Platinum Member
- Greetings from Utrecht, Holland
I agree, definitely. Especially since you're not supposed to see these ID's anywhere and use them sparsely in actions. Which by the way also could be an argument to keep the convention we were used to. We never talk about them, they are only copy-pasted from the url to another input field.
I'm still using v1.7, and even there are some dialogs (eg change family members - add) where the xref cannot be used to find the person you need. So I use work-arounds like first edit the name and put in a suffix "!" for me to know which one it is.
> but I would like to understand the reason for that the XREF must always start with a "X".
Technical simplification. First there was a counter for each record type for each tree. Then the separation per tree vanished, and even in v1.7 there might now be just one global counter.
So I stopped caring, it's just an xref, but it itches for the OCD part in me.
> I'm not used to write php code.
Neither am I. Last time I counted it was 14 languages (in 3 decades) and php is not one of them. I might have missed a $ here or there.
> Is it possible to have two functions with the same name, once with and once without parameter ?
I jusr googled "php function overloading" and you're right! Functions are unique by name, not by their argument count or type. So throw away my attempt, it's no good.
> If XREFs of individuals as well as families start both with X I will have problems with merging double records.
No, in case you erroneously try to merge X123 with X345 where they don't are of the same type, a merge attempt would (should) not be accepted. Also you can have F123 and X123. They are unique, not only their numerical part but including the alphabetic prefix.
stamboom.BertKoor.nl runs on webtrees v1.7.13
Please Log in or Create an account to join the conversation.
- Andreas
- Offline
- Premium Member
Thank you for trying to give an explication and be so honest.
By the way, what's your personal reason to stay with 1.7.x ?
My opinion is, never touch a running system.
But as no new features will be added in v1.7.x and even certain bugs are not elimininated, my break even reached.
Both MAUPILLÉ & RAUHUT families are using webtrees V2.1.18
Please Log in or Create an account to join the conversation.
- bertkoor
- Away
- Platinum Member
- Greetings from Utrecht, Holland
I expected the difference between 1.7 and 2.0 to be mainly internal and technical. But visually it's rather a step, and functionally I read about some surprises.
But maybe I should just try...
stamboom.BertKoor.nl runs on webtrees v1.7.13
Please Log in or Create an account to join the conversation.