mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #5655] NamingStrategy::joinTableName not being called #9683
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?
Original Pull Request: https://github.com/doctrine/orm/pull/5655
State: closed
Merged: No
This problem exists for M2M without a tableName (because a NamingStrategy may take care of the table name) and XML Drivers
Explanation:
Although a joinTable MUST have an tableName eventually, it is actually valid to have it not declared IF a naming strategy would generate one (always true if not defined (null)).
However this XML driver will will parse an omitted declaration as an empty string. The ClassMetadataInfo Class is expecting an unset value or it will break.
ClassMetadataInfo will show a
Notice: Uninitialized string offset: 0which makes sense if you look atsee
More importantly the (default) naming strategy will now never be called and the resulting ClassMetadataInfo has no table name defined, which results in a 'Invalid table name specified' Exception
see
Please tell me if this is something we can merge without further proof, I don't really understand how to add a test case for it (I have looked at the existing cases, but... pfft)