Infinite loop when trash and eck_bundle_permissions modules are installed

Created on 12 December 2024, 10 days ago

Problem/Motivation

Having both the trash and hook_event_dispatcher modules installed causes an infinite loop, leading to a segmentation fault when running drush cr and 'Fatal error: Allowed memory size of X bytes exhausted' when visiting the website.

I was able to track down the cause of the infinite loop:

  • trash_entity_query_alter calls EntityTypeManagerInterface::getDefinition()
  • eck_bundle_permissions_entity_type_alter does an entity query

Steps to reproduce

Have both modules installed and run drush cr.

Proposed resolution

I can't eliminate the entity query from eck_bundle_permissions_entity_type_alter, but it seems like TrashManagerInterface::isEntityTypeEnabled() only uses the entity type ID from the entity type object that's being passed. Why not just pass the entity type ID then? We're also just passing the bundle ID, not the whole object. This would eliminate the EntityTypeManagerInterface::getDefinition() call in trash_entity_query_alter and fix the issue.

User interface changes

None.

API changes

The $entity_type argument is replaced with $entity_type_id. Since we're changing a public interface, this change might need a new major version.

Data model changes

None.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024