[PR #5832] XMLDriver does not parse inversed-by when no Join is defined. #9747

Closed
opened 2026-01-22 16:05:18 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/5832

State: closed
Merged: No


Since 2.5 (https://github.com/doctrine/doctrine2/issues/1749) the Join no longer required, but this causes an invalid warning because the "inversed-by" is not being parsed and added to the metadata of the association.

The warning:

The field Customer#accounts is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity Account#customers does not contain the required 'inversedBy="accounts"' attribute.

The doctrine mapping xml's:

   <entity name="Customer">
       ...
        <many-to-many target-entity="Account" field="accounts" mapped-by="customers" >
            <cascade>
                <cascade-all/>
            </cascade>
        </many-to-many>
    </entity>

    <entity name="Account">
        ...
        <many-to-many inversed-by="accounts" target-entity="Customer" field="customers">
            <cascade>
                <cascade-all/>
            </cascade>
        </many-to-many>
    </entity>
**Original Pull Request:** https://github.com/doctrine/orm/pull/5832 **State:** closed **Merged:** No --- Since 2.5 (https://github.com/doctrine/doctrine2/issues/1749) the Join no longer required, but this causes an invalid warning because the "inversed-by" is not being parsed and added to the metadata of the association. The warning: ``` The field Customer#accounts is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity Account#customers does not contain the required 'inversedBy="accounts"' attribute. ``` The doctrine mapping xml's: ``` xml <entity name="Customer"> ... <many-to-many target-entity="Account" field="accounts" mapped-by="customers" > <cascade> <cascade-all/> </cascade> </many-to-many> </entity> <entity name="Account"> ... <many-to-many inversed-by="accounts" target-entity="Customer" field="customers"> <cascade> <cascade-all/> </cascade> </many-to-many> </entity> ```
admin added the pull-request label 2026-01-22 16:05:18 +01:00
admin closed this issue 2026-01-22 16:05:18 +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#9747