Skip to content

fix(doctrine): keep the resource metadata factory inside the metadata cache - #8770

Open
Pixelshaped wants to merge 1 commit into
api-platform:4.2from
Pixelshaped:fix/doctrine-metadata-factory-cache-priority
Open

Pixelshaped wants to merge 1 commit into
api-platform:4.2from
Pixelshaped:fix/doctrine-metadata-factory-cache-priority

Conversation

@Pixelshaped

@Pixelshaped Pixelshaped commented Oct 27, 2026 •

Copy link
Copy Markdown

Fixes #8769

Not entirely sure why priorities were changed in #7739 @alexisLefebvre?

@Pixelshaped
Pixelshaped marked this pull request as ready for review October 27, 2026 15:36
@Pixelshaped
Pixelshaped force-pushed the fix/doctrine-metadata-factory-cache-priority branch from db24e12 to 525efd4 Compare October 27, 2026 17:14
@Pixelshaped
Pixelshaped force-pushed the fix/doctrine-metadata-factory-cache-priority branch from 525efd4 to 90564cb Compare October 27, 2026 17:15
@alexisLefebvre

Copy link
Copy Markdown
Contributor

Good catch, thanks. The #7739 commit says "Adjust Doctrine metadata factory decoration priorities to ensure correct execution order", but looking at it again the move wasn't needed. setParametersFilterClass() only needs the parameters built by ParameterResourceMetadataCollectionFactory, which was already decorated at 1000, so it ran before the Doctrine factory at 40. Going below -10 only moved the Doctrine factory outside CachedResourceMetadataCollectionFactory, which wasn't intended. -5 keeps it inside the cache and still after every other factory, so 👍 for this fix.

Could you check that tests/Functional/Parameters/DoctrineTest.php (the stateOptions test from #7739) still passes with -5? CI seems broken for unrelated reasons right now.

@Pixelshaped

Copy link
Copy Markdown
Author

I ran DoctrineTest.php and it passes at -5. That includes State options and State options and no api filter, the two tests tied to #7739’s stateOptions behaviour.

I pushed on 4.2 because the bug was introduced on 4.2 but the CI seems otherwise broken on 4.2. I can target another branch if needed.

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

Successfully merging this pull request may close these issues.

2 participants