Adoption causes wrong birth statistics

Bug #1226603 reported by Ben M.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
webtrees
Triaged
Wishlist
Unassigned

Bug Description

Dear dev team!

I face the following bug:
An adoption will make the mother appear in "oldest mother giving birth".

Example:

i01 is born in 1939 by i02 (father) and i03 (mother).
father marries another woman (i04).
child i01 is being adopted by the new family i02 and i04.

i02 (mother) is born in 1906.
i04 (adopted the child ) is born in 1881.

Now my statistics.php sais, i04 is the oldest mother with the child i01 at the age of 58 (1881 + 58 = 1939).

Well, adoptions shouldn't count into "to give birth". Otherwise a 100 year old would show up in the statistics.

Version: webtrees 1.4.3

Best regards & thanks for your efforts!

Revision history for this message
fisharebest (fisharebest) wrote :

The statistics use very simple logic, so that they can run quickly.

In particular, they only use queries that can be performed on the database - not ones that involve loading and analyzing records.

In this case, it *might* be possible to exclude records containing non-birth pedigrees. But if not, or it has an adverse impact on performance, we might simply have to change the definition of "oldest mother"

Changed in webtrees:
status: New → Confirmed
Revision history for this message
Ben M. (bmhm) wrote :

Okay, let's see if I can help.

 function oldestMother() { return $this->_parentsQuery('full', 'DESC', 'F'); }

Where you got:
 " SELECT SQL_CACHE".
 " parentfamily.l_to AS id,".
 " childbirth.d_julianday2-birth.d_julianday1 AS age".

I haven't reviewed the full SQL statement yet, but I'd say the fact or name childbirth is confusing. It sounds as if the child (in my example i01) has got two birthdays: the day he was actually born and the day of the adoption (which I omnitted).

I'll take a look into it to find out whether it is possible to filter out adopted childs.

Changed in webtrees:
status: Confirmed → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.