fisharebest / webtrees

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

(1.7.13) "Nesting level too deep - recursive dependency?" - wrong URL parameter! #2391

Closed baumbuwe closed 5 years ago

baumbuwe commented 5 years ago

In "control panel/edit user" a user account was manually given a wrong spelled ID "i2" (instead of "I2") for "Individual record". Here the input was accepted and stored in that form.

Logging in as this user you may find at module "homepage" a link to "Default individual" -> URL with individual parameter

https://webtrees.site/individual.php?pid=i2&ged=myGED

Calling this URL you will get:

Fatal error: Nesting level too deep - recursive dependency? in /.../WebTrees/app/Theme/AbstractTheme.php on line 1441

wheras the same URL with pid=I2 will properly work,

Either it would be a nice thing to check for existence any entered individual ID in all configuration places where an individual ID may be entered, or (I think, a better idea) to avoid this error and give back standard error page "This individual does not exist or you do not have permission to view it"

(to be curious: where and why comes the recursion from?)

fisharebest commented 5 years ago

I cannot reproduce this. What version of PHP do you have?

I guess that you might be able to fix this by editing the file AbstractTheme.php and adding a third parameter true in the call to in_array on line 1441.

Can you test this fix for me?

(to be curious: where and why comes the recursion from?)

Without the true parameter, in_array is comparing the object attributes recusively, rather than checking if the actual objects are the same.

baumbuwe commented 5 years ago

PHP Version 7.2.16

Testing fix...

baumbuwe commented 5 years ago

... solved error

baumbuwe commented 5 years ago

should be merged into master...