zoeck Posted September 4, 2018 Share Posted September 4, 2018 Hello, I have a problem with a page reference field. (PW 3.0.98 and 3.0.111) This is an employee list, each employee can also enter a substitute in his or her user profile. If now two coworkers, mutually as representatives register themselves, the output simply hangs. "Show all Employees" Template: employees "Employee Page" Template: employee_entry This are the fields of employee_entry: This is my selector: <?php $allemployees = $pages->find("parent=/verwaltung/mitarbeiter/, template=employee_entry, emplastsync={$lastsynctime}"); And then, there's the Page Reference Field "emprep": <?php foreach($allemployees->sort(array('emptext.lastname', 'emptext.firstname')) as $employee) { echo $employee->emprep->title; } And if both employees have each other as representatives, the following error occurs: Quote Allowed memory size of 262144 bytes exhausted (tried to allocate 24576 bytes) If another employee is selected as a representative, there are no problems! If I open a page directly with employee_entry, there are no problems! Only if I output the list on another page (in this example on a page with the "employees" template) I just don't know how to solve the problem ? I hope you can help me here, thank you! Link to comment Share on other sites More sharing options...
Robin S Posted September 4, 2018 Share Posted September 4, 2018 PW cannot handle circular references in Page Reference fields:https://github.com/processwire/processwire-issues/issues/152https://github.com/processwire/processwire-issues/issues/572 Link to comment Share on other sites More sharing options...
zoeck Posted September 4, 2018 Author Share Posted September 4, 2018 Oh... thats not good ? Is there a workaround? Is it possible that I only get the name and the Url/ID instead of the whole page`? /edit: It seems that the problem does not occur if you change the Page Reference field to "multiple pages"... 1 Link to comment Share on other sites More sharing options...
adrian Posted September 4, 2018 Share Posted September 4, 2018 7 hours ago, zoeck said: Is there a workaround? There are several outlined in the second Issue that @Robin S linked to. It would actually be great if you could comment on that issue to get Ryan's attention once again if you wouldn't mind. 2 Link to comment Share on other sites More sharing options...
zoeck Posted September 5, 2018 Author Share Posted September 5, 2018 20 hours ago, adrian said: There are several outlined in the second Issue that @Robin S linked to. It would actually be great if you could comment on that issue to get Ryan's attention once again if you wouldn't mind. Done ? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now