mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #473] [CLOSED] Fixes bug whereby orphan-removal value in XMLDriver is incorrectly parsed as true #8252
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/473
Author: @mjphaynes
Created: 10/11/2012
Status: ❌ Closed
Base:
master← Head:master📝 Commits (1)
614c7feFixes 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.