Fatal error: Allowed memory size exhausted

Created on 20 November 2023, 7 months ago
Updated 12 June 2024, 14 days ago

Problem/Motivation

If there are a lot of records to reference to, a fatal error occurs: Allowed memory size exhausted in web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php on line 484.

Steps to reproduce

  • Create around 100'000 records of a content type to reference
  • Create a content type with an entity reference field to the before mentioned content type
  • Install verf module
  • Create a view of the second content type
  • In the Filter criteria section click on "Add"
  • In "Add filter criteria" modal dialog select the entity reference field verf filter
  • Click on "Apply" in the modal dialog
  • The dialog remains open, close it by clicking on top right x
  • Reload the views page

Proposed resolution

The error is caused by too many referenceable entities. Therefore, add some sort of limit in Drupal\verf\Plugin\views\filter\EntityReference::getReferenceableEntities(), both if no target bundles are selected and if target bundles are selected on the filter configuration form.

πŸ› Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland boromino

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

Comments & Activities

Production build 0.69.0 2024