Skip to content

Conversation

@k0ka
Copy link
Contributor

@k0ka k0ka commented Dec 18, 2021

Problem

The InteractsWithEntities trait has entitiesMatch/noEntitiesMatch assertions which accept criteria as an argument. This criteria might contain other entities: for example if we are searching by a ManyToOne relation. The code outputs criteria in print_r. But in a complex setup where entityA has the relation to entityB and entityB has the relation to entityA this may end up with a circular dependency and fail with the PHP error Allowed memory size of X bytes exhausted

Changes proposed in this pull request:

  • All entities in criteria in InteractsWithEntities are replaced by their ids.
  • simple tests for InteractsWithEntities

@eigan eigan merged commit 832ebf5 into laravel-doctrine:1.7 Dec 20, 2021
@eigan
Copy link
Contributor

eigan commented Dec 20, 2021

Thanks! :)

DemianShtepa added a commit to DemianShtepa/orm that referenced this pull request Dec 28, 2022
1.7.13
- Hashing password-reset tokens before storing (laravel-doctrine#508 laravel-doctrine#506) @rosamarsky
- Trying to print_r circular entity dependency results in OOM in InteractsWithEntities  (laravel-doctrine#510) @k0ka

Breaking change:
- All password reset tokens will be invalidated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants