fisharebest / webtrees

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

Error with individual and Family lists #4904

Closed ddrury closed 10 months ago

ddrury commented 11 months ago

Have just updated my test system to the latest code (https://github.com/fisharebest/webtrees/commit/6e8002182a6bbfa2316898120b7075a4beb047ff) and I now get the following messages for both the Individual & Family list pages

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

and if I go back to the previous page I see a number of messages: There are no individuals with the surname ““ (I guess each message corresponds to a redirect attempt)

UPDATE: Seems to only fail when called from "My page" If called from an individuals page then it works

fisharebest commented 11 months ago

Dang. I know what I've done, without looking at the code.

fisharebest commented 11 months ago

Actually no - I can't reproduce this. What is the link that you are following from "My page"?

ddrury commented 11 months ago

demo

ddrury commented 11 months ago

I've realised that this fails whenever there is no surname parameter on the calling url. See attached image. I arrived on this page by selecting the individual list from my own details page, but now selecting G (for example) results in a URL with no surname parameter and we see the same problem demo1

ddrury commented 11 months ago

Changing line 219 of app\Module\IndividualListModule.php to if ($surname !== '' && !array_key_exists($surname, $all_surns)) { seems to solve the problem.

fisharebest commented 11 months ago

That was the fix I had in mind for my first comment. But couldn't reproduce the error. Will have another look later.

ddrury commented 11 months ago

I think my solution above is back to front in that you need to fail when there is no surname parameter, maybe valid urls within webtrees should always have a surname parameter of some sort

fisharebest commented 10 months ago

All my test trees contain at least one individual without a surname. Hence the array_key_exist check always passed, even when $surname === ''