Jump to content

Error on login with custom user template


gebeer
 Share

Recommended Posts

Hello,

I have a site with users that have a custom user template setup on  PW 2.7.2 stable.

Custom user template is "member" and role for those users also "member".

The site has a frontend dashboard where users can edit their profile, events etc.

I can login with this user type to the backend fine and the permission settings are all working.

When I login to the frontend, I get this error: "Fatal error: Maximum function nesting level of '10000' reached, aborting! in .../wire/core/Wire.php on line 333";

I already raised the xdebug.max_nesting_level from 1000 to 10000. When I set it to 100000, the server disconnects.

I can see that the user gets logged in with $session->login($uname, $pass) before the error is thrown.

EDIT: When I reload the login page after the error shows with the now logged in user, I get this error: "Fatal error: Maximum function nesting level of '10000' reached, aborting! in /var/www/utgpw/wire/core/Fieldgroup.php on line 61"

But a $session->redirect($dashboard->url) seems to cause the error.

If I logon with a test user that has role "member" but the regular user template, I don't get the error and get redirected to the dashboard fine. All the code in my dashboard template is working.

Actually, the whole login and dashboard logic for the frontend is copied from another site where it has been working fine for over a year now.

So I guess the problem is related to how the custom user templates are handled in the core. My setup for the custom user template has also proven to work without issues in 2 other sites.

I have spent hours on debugging already and now I'm lost. Any ideas that point to the cause of this would be much appreciated.

Link to comment
Share on other sites

Yeah, I never had to raise it above 200 before. When xdebugging the login template it seems like it is going in loops. Makes my head spin.

Meanwhile I found that even with the $session->redirect part commented out I get the error (see my EDIT in the OP) while reloading the login page. Then it ppoints to /wire/core/Fieldgroup.php on line 61.

EDIT: Now I commented everything out in the login template. When I load the page while the user is still logged in, I get the error again.

Link to comment
Share on other sites

@tpr

not that I'm aware of. There is nothing special going on after login. User stays on the login page and gets presented with a logout button.

In the meantime I made a fresh 2.7.2 stable install, added the custom user template/parent and role just as on the problem-site. I copied over the login logic to the new test install and can login fine.

So the problem must be somewhere within other code on that site. I spent hours on debugging and can't seem to find the reason.

In Xdebug panel I see that the site hangs for a while at line 61 of wire/core/Fieldgroup.php and then throws the fatal error. My Xdebug call stack is then filled with 10000 lines. Would it help if I made a pastebin with the xdebug call stack, could anyone see from that where the problem lies?

EDIT: my member user template has about 20 fields. I tried removing all but the required ones. But the error still persisted. So it is not related to the user fields either.

EDIT2:

Into the clean install of PW 2.7.2 I imported all fields/templates from the affected site. Created a testuser with the custom member template and can login fine.

Something seems screwed with the site that has the problem.

Before wasting more hours on debugging the problematic install, I will rather import the content to the new blank install that now has all fields/templates that I need.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...