Jump to content
gebeer

Error on login with custom user template

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.

Share this post


Link to post
Share on other sites

There's certainly something fishy going on. I've xdebug running with max nesting of 300 and never had a problem (the default 100 is to few) and I'm using custom user templates as well.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Do you compare two objects in your code somewhere? That can lead to such error.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By JeevanisM
      Hi All,
      I am trying to build a PW website upon the  HTML design as shown here : https://bit.ly/2HxZbwr
      As you can see,  I use a repeated block to display a divider between sections on the page, its an image background-text on top. The screenshot is here :
      Now, I created a new field for this block content and attach that field to my Home Page template. But in HTML design, I used this block in two places, on on top side, and one on the footer. Now, when I do it in PW, can I use one same field multiple times in a single page template ? I have read this thread about using fields in efficient way, but I could not figure out, how to use same field multiple times in a page template.

      I hope I did not confused any one with my query, please let me know the correct PW way to achieve  this.
       
      thanks
      Jeevz
       
    • By louisstephens
      Hopefully this is the right place, if not, please move it to the proper sub. I installed the multi language module on my development (sandbox) set up not too long ago to test out a few things. From the start, I ran into some issues with dependencies not being met/installed, so I thought that I would simply just uninstall what had been. Unfortunately, that took me down a road of using some code in my home template to remove the modules (cant find it at the moment). After some struggling, I finally got it uninstalled, but it left behind 3 fields,
      language language_files language_files_site I thought that I could simply remove them from the languages template and then delete them, but I get the following error:

      I was wondering, is there a way to remove these using the api? I couldn't add any new users to the setup until I made "language" not required, but I was hoping to just remove all of the fields.
    • By DevCat
      Hi,
      I'm trying to install ProcessWire on XAMPP localhost. I extracted the zip and put the files from master folder to website directory folder and when I go there with Firefox it says 404 page not found (no site configuration or install.php available). At least install.php surely is there. I'm doing WordPress installations on localhost almost every day and no problems. Does anyone here know what is cause for this error?
    • By Marcel
      Hey,
      I am about to use the tool Create Users Batcher. We have 450 users. When I tryed it with like 20 test users it worked but it took a while. Now my concerns are that 450 might be to stressful? Does anyone have experience with several hundreds of users? My thoughts are to split it in smaller goups and upload them one group after another.
      best wishes
      marcel
    • By anderson
      Hi all,
      I'm a new to website building. Learned some CRASH course of js,jquery,php. Then I found CMS. Still learning around forum, youtube....
      Anyway, please help me with some beginer questions:
      1, About template - please correct me if I understand wrong : every page should be (or recommended) built on a template. So if in total I'll have 10 pages, 2 of them have same layout, I'll need 9 templates.  And, what fields a page includes, is not defined in page, but defined in the template that page uses. 
      2,  Where to see what modules I've installed? is it in "Modules - Site"? 
      3, I installed "PageTable Extended", then what?  As in a youtube tutorial, it should appear in Setup tab, but it doesn't.  What's in there: templates,fields,logs,comments. (I installed "Uikit 3 site_blog profile".)
      4, I did a search in Processwire website for the famous "repeater matrix" module, and can not find it, there's a Repeater, as well as a Matrix. Is it not a module?
      5, I watched this youtube tuts: https://www.youtube.com/watch?v=IHqnLQy9R1A
      Anybody familiar with this tuts please help: 
      After he analysed a target webpage layout he wanted to mimic, he created some fields, some template, then based on those he created a page and input some "content" in there, then clicked "view", it's just some text. So, here comes my question, he copied a folder "assets" (subfolders are: css,fonts,js,img) over, then the page have the appearance/layout he wanted to mimic. Where does that assets folder come from?
      Appreciate any help.
×
×
  • Create New...