Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DoctrineBridge] Fix automapping#44987

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.4frommbabker:fix-auto-mapping
Jan 26, 2022

Conversation

@mbabker
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#44355
LicenseMIT
Doc PRN/A

This should fix the broken automapping configuration for bundles that use annotations and attributes, see#44355 for additional details.

When using the newer bundle directory structure conventions, especially with theBundle::getPath() method overridden to point the bundle root path to the Bundle class' parent directory, the issue comes up because the bundle filesystem root path does not match the root path for the actual bundle code (effectively the PSR-4 root path).

To fix automapping, theAbstractDoctrineExtension::detectMetadataDriver() method will be called a second time with the Bundle classpath if the first call (which is effectively the same asBundle::getPath()) can't resolve the appropriate mapping type. This will also update setting$bundleConfig['dir'] for drivers that are based on PHP classes so that the root path is based on the bundle classpath (AKA the PSR-4 root path) instead of the bundle path.

The bulk of this patch is mainly from adding test fixture bundles to be able to test theAbstractDoctrineExtension::getMappingDriverBundleConfigDefaults() method in this repo and ensuring that the metadata driver detection works right for all of the supported drivers.

keichinger, SimonVanacco, and tperunsky reacted with thumbs up emojikeichinger reacted with heart emojikeichinger reacted with rocket emoji
@carsonbotcarsonbot added this to the5.4 milestoneJan 12, 2022
@carsonbotcarsonbot changed the title[DoctrineBridge][5.4] Fix automapping[DoctrineBridge] [5.4] Fix automappingJan 12, 2022
@SimonVanacco
Copy link

This fixes the issue in my codebase !

@nicolas-grekasnicolas-grekas changed the title[DoctrineBridge] [5.4] Fix automapping[DoctrineBridge] Fix automappingJan 26, 2022
@nicolas-grekas
Copy link
Member

Thank you@mbabker.

@nicolas-grekasnicolas-grekas merged commit5cad3b6 intosymfony:5.4Jan 26, 2022
@mbabkermbabker deleted the fix-auto-mapping branchJanuary 26, 2022 17:44
This was referencedJan 28, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@tperunskytperunskytperunsky left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

6 participants

@mbabker@SimonVanacco@nicolas-grekas@tperunsky@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp