[PR #1085] [CLOSED] Orphan removal does not work nicely with preRemove listeners #9137

Open
opened 2026-01-22 16:03:21 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/1085
Author: @raziel057
Created: 7/22/2014
Status: Closed

Base: old-prototype-3.xHead: orphan-removal


📝 Commits (7)

  • e0365f0 Failing Test - Cascade Remove with orphanRemoval
  • 62fbf49 Success Test - cascade remove without orphanRemoval
  • 8af6144 Update DDC0000Test.php
  • 57783fc Update DDC0000Test.php
  • f0961d7 Update DDC0000Test.php
  • bc73ebc Update DDC0000Test.php
  • b19fbbc Update DDC0001Test.php

📊 Changes

2 files changed (+258 additions, -0 deletions)

View changed files

tests/Doctrine/Tests/ORM/Functional/Ticket/DDC0000Test.php (+129 -0)
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC0001Test.php (+129 -0)

📄 Description

Hi,

I created 2 tests to show that we encounter a problem when using orphanRemoval (see e0365f0d18).

-> The ActionLog is created with no value in the "action" column.

That's not the case when removing manually (see 62fbf49654).

-> The ActionLog is created with value "remove" in the "action" column.

I think the behavior must be the same in the 2 Tests.

For information, I discovered the problem when using https://github.com/KnpLabs/DoctrineBehaviors/blob/master/src/Knp/DoctrineBehaviors/ORM/Loggable/LoggableListener.php with a custom callable DB logger.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/1085 **Author:** [@raziel057](https://github.com/raziel057) **Created:** 7/22/2014 **Status:** ❌ Closed **Base:** `old-prototype-3.x` ← **Head:** `orphan-removal` --- ### 📝 Commits (7) - [`e0365f0`](https://github.com/doctrine/orm/commit/e0365f0d1837edc2459990041398ade472354e5e) Failing Test - Cascade Remove with orphanRemoval - [`62fbf49`](https://github.com/doctrine/orm/commit/62fbf49654b3ea751bec824e9a047d45aa899b7a) Success Test - cascade remove without orphanRemoval - [`8af6144`](https://github.com/doctrine/orm/commit/8af6144afe31013f327e76e26be47de975e13282) Update DDC0000Test.php - [`57783fc`](https://github.com/doctrine/orm/commit/57783fcfbed7ca084626fe387a33a127d50a1df1) Update DDC0000Test.php - [`f0961d7`](https://github.com/doctrine/orm/commit/f0961d74a84038fbe7f318c7e093a9b3b76f2029) Update DDC0000Test.php - [`bc73ebc`](https://github.com/doctrine/orm/commit/bc73ebc3fa343dabc7e82a803ea9f9f14a6db4df) Update DDC0000Test.php - [`b19fbbc`](https://github.com/doctrine/orm/commit/b19fbbc87e652866f50930c6aa151c18477ad2c1) Update DDC0001Test.php ### 📊 Changes **2 files changed** (+258 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tests/Doctrine/Tests/ORM/Functional/Ticket/DDC0000Test.php` (+129 -0) ➕ `tests/Doctrine/Tests/ORM/Functional/Ticket/DDC0001Test.php` (+129 -0) </details> ### 📄 Description Hi, I created 2 tests to show that we encounter a problem when using orphanRemoval (see https://github.com/raziel057/doctrine2/commit/e0365f0d1837edc2459990041398ade472354e5e). -> The ActionLog is created with no value in the "action" column. That's not the case when removing manually (see https://github.com/raziel057/doctrine2/commit/62fbf49654b3ea751bec824e9a047d45aa899b7a). -> The ActionLog is created with value "remove" in the "action" column. I think the behavior must be the same in the 2 Tests. For information, I discovered the problem when using https://github.com/KnpLabs/DoctrineBehaviors/blob/master/src/Knp/DoctrineBehaviors/ORM/Loggable/LoggableListener.php with a custom callable DB logger. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:03:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9137