Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing partner leaves a single-person family #5085

Open
BertKoor opened this issue Dec 23, 2024 · 1 comment
Open

Removing partner leaves a single-person family #5085

BertKoor opened this issue Dec 23, 2024 · 1 comment

Comments

@BertKoor
Copy link
Contributor

Example of a family consisting of only partners (not yet parents)
https://dev.webtrees.net/demo-dev/tree/demo/family/f62/Lord-Charles-Bentinck-Anne-Wellesley
From the menu Edit - Change Family Members.
Remove either person from the family. The family itself still exists afterwards.

In the 1.x branch of webtrees it would also remove the family, since a family of a single person does not serve a purpose.
In the 2.x branch of webtrees it does not remove the family.

Can we have old behaviour back, or is there a rationale I'm missing?

@fisharebest
Copy link
Owner

The rationale was #4497

Family records are only deleted if they contain no significant facts.

The logic used is:

// If we have removed a link from a family to an individual, and it now has only one member and no genealogy facts
if (
$linker instanceof Family &&
preg_match('/\n1 (ANUL|CENS|DIV|DIVF|ENGA|MAR[BCLRS]|RESI|EVEN)/', $new_gedcom, $match) !== 1 &&
preg_match_all('/\n1 (HUSB|WIFE|CHIL) @(' . Gedcom::REGEX_XREF . ')@/', $new_gedcom, $match) === 1
) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants