Jump to content

Problem with Page Reference Field


zoeck
 Share

Recommended Posts

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:

image.png.39befc026faee52f2751be6e92466075.png

 

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

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"...

  • 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...