Jump to content

Loop with page fields generates memory problem


godmok
 Share

Recommended Posts

Hi everyone,

this is more a note than a question but I also wanted to know if it is wanted to be like that, and I didn't find any Info on this.

I had a structure like that: my site has a user-profile page and a PW user. The user has a page field to link it to its profile page. So far so good, but to get some information from the PW user I set a page field into the profile page, so both pages are bound by two lines (profile<=>user). Each line goes in only one direction.

What happened after is this: the server run out of memory (allocation?). Seems like the page input fields run in circles. The page was still shown, but broken, with the error at the bottom.

The fix was easy: just put one page field into the PW user, link that with the profile and do a $users->find("page_field=$page->id") in the template of the site. Easier done could be to use the $page->createdUser profile value, but that makes it a little more complicated to change at creating the user and profile site. Will do that later on. Many ways to go, I like that the most on PW :)

As I understand this can happen to any pages, so be warned to not combine pages like this. There are better ways.

So: is this a wanted logic? Two pages can loop into each other? Are there any security notes on something like this, maybe on the docs? Or something like small notes to DO NOT do something like this or be warned somehow?

Thanks!

  • Like 1
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...