-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotation receives array of paths instead of reader #9668
Comments
Seems that this is happening here: In my case, I'll try to prepare a fix asap. @Ocramius |
has already been reported here: doctrine/DoctrineModule#774 |
Did you also upgrade (voluntarily or not) |
@greg0ire not possible as this is a Laminas project, and |
This is caused by a BC-break I introduced in #9587, where the ORM annotation driver no longer extends the one from persistence 😬
Wrong assumption, @greg0ire from the past! |
Suggestion on my end is to revert the offending (involuntary) BC break for now, and release That means re-introducing some tech debt, and planning its removal for |
In ORM? I figured it does cause an issue while trying to revert: #9670, but I think conditionally defining the class based on some condition should allow us to retain compatibility with Persistence 3. |
Depends if the consumer would observe an API change or not: remember that any API change caused by third-party packages being installed or not is still an API change -> BC break. EDIT: anyway, I suggest:
|
The API change would occur if a consumer was not pinning I think it's fair to have this BC break in the case persistence is upgraded to 3, because if you depend on the annotation driver and it extends the API from persistence, then you depend on persistence. I've made an attempt at the revert because it sounded like it would be fast, but it looks like we already built on top of this: #9670 , so it won't be a simple revert I'm afraid. |
The referenced symbol ( A suggestion could be to:
|
At that point I think we would be better off merging either doctrine/DoctrineModule#776 or doctrine/DoctrineModule#775 and hope this is the only legitimate issue caused by this BC break. |
Correct: this allows moving to newer
Consistency is still secondary to BC, heh.
The BC break is still there for anyone using |
The cure seems worse than the disease here. I agree that you have to think of the consumers, but they are usually pretty vocal when it comes to BC-breaks, and so far this is the only complaint we got about it. I asked other maintainers what they thought and tried hard not to steer them in any direction, and they pointed out that the code in the module will need to be fixed for the new class anyway. I think we should merge a quick fix, and ask the maintainers of the Laminas integration to rethink that piece of code entirely, and be done with it. Same goes for https://github.com/Roave/psr-container-doctrine/blob/3.6.x/src/DriverFactory.php#L52 Note that both pieces of code got worse when |
I'm not sure if my message is getting through: As I already mentioned, code will be improved where/when there is time to do so (especially when required in a new major release of |
I don't doubt that, what I doubt is that there are that many type checks on |
Be my guest in fixing symptoms. Seriously, just fix the BC break, and all is good 😛 I'll gladly accept patches that improve the PSR integration too, but beware that this still broke all released versions anyway. |
I would if it wasn't that hard, but I'm more confident in fixing the symptoms as you say 😅 Hopefully people who upgrade the ORM will also be able to upgrade both other packages 🤞 |
While I agree that changing the inheritance chain is a potential BC break, I'm not sure I 100% follow the argument of the BC break here. The code in question assumes that all driver classes that require an annotation reader are child classes of the That being said, we have to acknowledge that this flawed piece of code has existed for roughly a decade now and that we would probably need to patch multiple legacy branches of DoctrineModule because applications that use older PHP versions than 7.4 have to pin DoctrineModule to an old version while still being able to upgrade to the latest ORM. My proposal to tackle the issue: #9671 We would still need to change DoctrineModule though, but we can do so when working on making it compatible with Persistence 3. |
Awesome, thanks! |
Bug Report
2.12.0 doesn't work with
doctrine/doctrine-orm-module
: 5.1.0.Summary
After upgrading from 2.11.1 to 2.12.0, I'm experiencing the following issue:
Current behavior
Reading Metadata no longer works through the
doctrine-orm-module
.In the following line:
orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
Line 82 in d550364
$this->reader
no longer contains the reader, but the array of paths:Currently, my best guess is, that this class is instanciated with a missing first parameter. And the paths are then passed as first parameter in the readers place.
How to reproduce
doctrine/doctrine-orm-module
: 5.1.0doctrine/orm
: 2.12.0PHP : 8.0.16
The text was updated successfully, but these errors were encountered: