hartenthaler / hh_extended_family

webtrees - showing the extended family of an individual (like cousins and uncles, aunts, ...)
GNU General Public License v3.0
23 stars 9 forks source link

Co-parents-in-law partnership incorrect #108

Closed jpretired closed 3 years ago

jpretired commented 3 years ago

Partnership is displayed incorrectly only with unlogged-in (anonymous) visitor. It is OK with logged-in visitor (member, ...). See screenshot:

co-parents-in-law

hartenthaler commented 3 years ago

I have already seen this, but thought that it is only a bug in my development version. Thank you for reporting this!

jpretired commented 3 years ago

I found the circumstances that bring about this issue. They are:

  1. In the family tree the privacy setting Show living individuals is set to Show to members.
  2. The family tree is visited by an unlogged-in visitor.
  3. There is a living individual in the family of proband's child whose parents-in-law (i.e. proband's co-parents-in-law) the module is seeking after. Typically a proband's grandchild.

Then we can see this 'Partnership families[$key]->fullName() ?>'.

Similarly for children-in-law if a child-in-law is private (living):

children-in-law

I hope this may help.

hartenthaler commented 3 years ago

It should be in this case "Partnership Private + Private" or "Child Private" if a family or a person cannot be shown.

I tried to reproduce the error, following your excellent analysis of the circumstances, but I was not successful. So I have to check this in more detail. Are you using the latest version of the module "extended family"?

jpretired commented 3 years ago

Yes, 2.0.16.54: image

If you wish, have a look at my family tree pages: Co-parents-in-law: https://www.jprodina.cz/tree/nase-rodina/individual/I605/Josef-Prause#tab-_hh_extended_family_

Children-in-law: https://www.jprodina.cz/tree/nase-rodina/individual/I201/Frantisek-Prause#tab-_hh_extended_family_

hartenthaler commented 3 years ago

Finally, I found it! It was a missing "=" sign!

The PHP code statement producing this is <h5><?= I18N::translate('Partnership') ?>&nbsp;<? $group->families[$key]->fullName() ?></h5>

but it should be: <h5><?= I18N::translate('Partnership') ?>&nbsp;<?= $group->families[$key]->fullName() ?></h5>

hartenthaler commented 3 years ago

will be fixed in next release

jpretired commented 3 years ago

GREAT!! Thank you very much! Was it difficult to find it?

Maybe you know that there are a few other similar buggy lines in file 'tab.phtml': line 632, 700 and 702 with missing '=' sign after '<?'.

After correcting them it solves also the Children-in-law issue.

hartenthaler commented 3 years ago

Yes. I looked at this point very often but didn't see it. My PHP version doesn't care about the missing "=", so I was not able to reproduce your issue. Finally, I have rewritten this part of the code and then I saw it. Yes, when you know what is missing, it was easy to find all these lines.

jpretired commented 3 years ago

I did not know that it may depend on PHP version. My PHP version is 7.4.24. What is yours? There is an interesting Q/A about <?= tag: https://softwareengineering.stackexchange.com/questions/151661/is-it-bad-practice-to-use-tag-in-php

hartenthaler commented 3 years ago

You are right, it is not depending on the php-Version. Whether <? is working or not is depending on parameters in php.ini. Thanks for your link!