After creating a new field on my content type I try to edit it at /admin/structure/types/manage/<content_type>/fields/<field_name> and hit the php timeout.
After some digging around it appears to be caused by the "Default value" select list that gets it's options from EntityReference_SelectionHandler_Generic::getReferencableEntities().
Each time I land on the page it is trying to populate the select list with 25,000 entities and can't manage it in the allotted 5 minute php timeout window.
Is there anything we can do to solve this massive performance hit, autocomplete, lazy load, any other suggestions?


OliverColeman’s picture

Version: 7.x-1.x-dev » 7.x-1.0

Same problem here. Have a content type with a few hundred thousand nodes. Luckily for me I don't need to reference this particular content type (and just happened to not select any bundle types in the Target Bundles setting for an entityreference field and so discovered this issue).

gargsuchi’s picture

Priority: Normal » Major

I am facing the same issue when i created a view to reference users. I have about 35K users in the system.
The view works perfectly fine, but the reference field gives a timeout error.
Upgrading this bug to Major.

Damien Tournoud’s picture

Status: Active » Closed (works as designed)

Don't use a select list or radio button widget if you have a large number of entities to reference, because that forces Drupal to load the whole list in memory and output the result in HTML. Use the autocomplete one.

There is really nothing else we can do here.

Damien Tournoud’s picture

Issue summary: View changes

Added code tags.