-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
Fix compatibility with doctrine/persistence 2.0 #1332
Fix compatibility with doctrine/persistence 2.0 #1332
Conversation
Class aliases need to be created on a place that it is always executed, previous code was only executed on an empty cache. Next request were always broken. Moving to the bundle class ensures the code is always executed.
Well, it works on a project, but not on the test suite, any ideas? Maybe adding the alias on the classes that needs them? |
IMO, these aliases are not really required by this package, but by "friendsofsymfony/user-bundle". Maybe we should just move them to |
It should be in |
Well, you are declaring this package as compatible with doctrine/persistence 2.0, but this package has a dependency that is not compatible. IMHO we either fix this with code like this one, or we can't do this. Someone just updates this packages and then code stops working. Agree on adding it to tests/bootstrap.php if that fixes the issue, but as I explained before I don't think that is the responsability of each user to know what we did here and add some alias so have the bundle working again. |
We could declare the BC method as a static one and call it every where we need the BC layer |
I think using |
@jordisala1991, do you have time to finish this PR? |
I will try tomorrow, yes |
* We MUST remove this method when support for "friendsofsymfony/user-bundle" is dropped | ||
* or adapted to work with "doctrine/common:^3". | ||
*/ | ||
private function createDoctrineCommonBackwardCompatibilityAliases(): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about making this method public static in order to call it in the custom_boostrap ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it would be bc break to remove it, IMO not a good idea.
Thank you @jordisala1991. |
Ok @phansys, I requested a new release for SonataUserBundle via Slack in If you want to get notified about new releases, make sure to follow SonataNews on Twitter! |
Subject
Class aliases need to be created on a place that it is always executed,
previous code was only executed on an empty cache. Next request were
always broken. Moving to the bundle class ensures the code is always
executed.
I am targeting this branch, because this is a bugfix and BC.
Closes #1331
Closes #1336
Changelog