Cannot View 1000+ entities. Needs paging or limit

Created on 10 October 2023, 9 months ago

Problem/Motivation

Unable to use the entity browser with fields that have 1000+ referenced entities

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 9341848 bytes) in /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php on line 446

Steps to reproduce

Create content with an entity reference to other content.
- Set form options for that field to "entity browser" + select Entity display plugin "Rendered entity", that runs out of memory much faster than just using "Entity label"

- Edit the content and link that field to 4000 other entities (you might get the error with much less, like 1000). you might need to do this programmatically

- Try and edit that content without getting a memory error. Even if it does not error, 1000+ entities is to much to view on one page!

Proposed resolution

Solution 1:
- Offer paging for the main view (it's available for selected entities, because you can link to a view)
Solution 2:
- Restrict main view to a maximum number of items

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.9

Component

Display plugins

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024