Skip to content
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

Incompatible with doctrine/persistence 3.x #135

Closed
bjo3rnf opened this issue Apr 12, 2023 · 6 comments
Closed

Incompatible with doctrine/persistence 3.x #135

bjo3rnf opened this issue Apr 12, 2023 · 6 comments

Comments

@bjo3rnf
Copy link
Contributor

bjo3rnf commented Apr 12, 2023

Hi,

after running composer update on my Symfony 5.4 app I get

Context: Using short namespace alias "LeagueOAuth2ServerBundle" by calling Doctrine\ORM\Configuration::addEntityNamespace  
Problem: Feature was deprecated in doctrine/persistence 2.x and is not supported by installed doctrine/persistence:3.x     
Solution: See the doctrine/deprecations logs for new alternative approaches. 

Is there anything I can do on my side except for downgrading doctrine/persistence to 2.5.7 (the last 2.x version I think)?

Thanks a lot for your help.

Cheers
Björn

PS: Same goes for a fresh install in Symfony 6.2

@bjo3rnf
Copy link
Contributor Author

bjo3rnf commented Apr 12, 2023

It seems that removing the registration of aliases in RegisterDoctrineOrmMappingPass is sufficient since FQNs are already used in queries.

@sdespont
Copy link

sdespont commented Apr 14, 2023

After testing, it is working if you don't install the last doctrine ORM 2.14.2 released on 2023-04-12

Use "doctrine/orm": "2.14.1" in composer

But I don't unserstand which part of the change is rising the error : #135

@bjo3rnf
Copy link
Contributor Author

bjo3rnf commented Apr 14, 2023

It's

['LeagueOAuth2ServerBundle' => 'League\Bundle\OAuth2ServerBundle\Model']
that's causing the issue. Registering of Aliases is deprecated and IMHO this can safely be removed. See also doctrine/orm#8818

@bobvandevijver
Copy link

@bjo3rnf is correct. This is the pull request that introduced the missing throw, which should have been there for quite some time already.

I believe the line can indeed be removed safely. See #137 for the PR to fix this.

chalasr added a commit that referenced this issue Apr 23, 2023
This PR was merged into the 0.4-dev branch.

Discussion
----------

Remove deprecated registration of entity namespace

Registration of entity namespaces has been deprecated in doctrine/persistence 2.x and prevents usage of the bundle in combination with doctrine/persistence 3.x. This patch addresses #135

Commits
-------

f634b1f Remove deprecated registration of entity namespace
@chalasr chalasr closed this as completed Apr 23, 2023
@sdespont
Copy link

@chalasr Thank you very much for the merge. Would it be possible to have a new release permitting to avoid the doctrine incompatibility?

@chalasr
Copy link
Member

chalasr commented Apr 25, 2023

Of course yes! I just forgot to push the tag. Here you go https://github.com/thephpleague/oauth2-server-bundle/releases/tag/v0.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants