[PR #473] [CLOSED] Fixes bug whereby orphan-removal value in XMLDriver is incorrectly parsed as true #8252

Closed
opened 2026-01-22 15:59:04 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/473
Author: @mjphaynes
Created: 10/11/2012
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • 614c7fe Fixes bug whereby orphan-removal value in XMLDriver is incorrectly parsed as true

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php (+3 -3)

📄 Description

I realise this is very hand wavy and if you require some more information or test cases then I can see about that.

However, just to get the issue logged, as I just spent 3 hours reverse engineering the doctrine code to find this, and it may help someone else.

Basically when reading the XML mapping data from generated XML files the orphan-removal value was being incorrectly parse as 'true' when it was set to 'false' in the mapping file.

I think this is because the XML parser was parsing the attribute as an object and when it was casted a boolean this meant the value became true. To overcome this I first cast the value as a string, and then to a bool.

Let me know if you need more information.

Thanks.


🔄 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/473 **Author:** [@mjphaynes](https://github.com/mjphaynes) **Created:** 10/11/2012 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`614c7fe`](https://github.com/doctrine/orm/commit/614c7fec824bba696e97e6f3f9d09a3609aeebf9) Fixes bug whereby orphan-removal value in XMLDriver is incorrectly parsed as true ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php` (+3 -3) </details> ### 📄 Description I realise this is very hand wavy and if you require some more information or test cases then I can see about that. However, just to get the issue logged, as I just spent 3 hours reverse engineering the doctrine code to find this, and it may help someone else. Basically when reading the XML mapping data from generated XML files the orphan-removal value was being incorrectly parse as 'true' when it was set to 'false' in the mapping file. I think this is because the XML parser was parsing the attribute as an object and when it was casted a boolean this meant the value became true. To overcome this I first cast the value as a string, and then to a bool. Let me know if you need more information. Thanks. --- <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 15:59:04 +01:00
admin closed this issue 2026-01-22 15:59:05 +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#8252