mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
2.15.1 generated warnings in AttributeDriver::joinColumnToArray() #7147
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?
Originally created by @verfriemelt-dot-org on GitHub (May 8, 2023).
BC Break Report
Summary
this change: https://github.com/doctrine/orm/pull/10671/files#diff-c058a8444ffba22cecd48a76b9577187ef8eba003369d9b8d94313b4325d1b76
results in warnings due to seemling a wrong data type beeing passed?
Previous behavior
no warnings
Current behavior
warnings described above
How to reproduce
the entity which triggers:
is that entity somewhat misconfigured? or is that a bug?
thanks for your effort ✌️
@verfriemelt-dot-org commented on GitHub (May 8, 2023):
mhmm, maybe thats a bit misleading, not sure.
here is a stacktrace when debugging that issue:
@greg0ire commented on GitHub (May 8, 2023):
🤔 where does that
point_targetcome from?@greg0ire commented on GitHub (May 8, 2023):
https://github.com/doctrine/orm/pull/10671 looks like it could cause the issue, Cc @BoShurik
@verfriemelt-dot-org can you try removing the lines introduced in that PR?
@verfriemelt-dot-org commented on GitHub (May 8, 2023):
yes, can confirm.
to be exact this part causes the issue:
seems we have assinged
$joinTableAttribute->inverseJoinColumnsas an instance ofinverseJoinColumninstead ofinverseJoinColumn[]and while iterating over that object, we get the first attribute which isname:@verfriemelt-dot-org commented on GitHub (May 8, 2023):
when checking where this is coming from, it might be this wrongly defined entity?
i guess
would be correct? 🤔
well yes in fact, that works with the new version then.
okay, so i had an issue with my setup. might be a good idea to add a warning/exception? 🤔
thanks for your help anyways :)
@greg0ire commented on GitHub (May 8, 2023):
Maybe yes… did the schema validation Symfony command not warn about the issue?
@verfriemelt-dot-org commented on GitHub (May 9, 2023):
nope:
and with the 2.15.1 i got the same issue like we discussed here:
@endelwar commented on GitHub (May 9, 2023):
Has the syntax below been deprecated and removed? I don't get any warning with both 2.14.3 and 2.15.0 (everything is working as expected)
Upgrading to 2.15.1 my Symfony 5.4 project throws an ErrorException: "Warning: Attempt to read property "name" on array" here
9bc6f5b4ac/lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php (L694), coming from9bc6f5b4ac/lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php (L442)If I change the
joinColumnandinverseJoinColumnsdeclaration 2.15.1 it works as expected:@greg0ire commented on GitHub (May 9, 2023):
As far as I understood that's because these join column declarations did not do anything in previous versions. Please let me know if I am wrong.