Skip to content

[DoctrineBridge] Make EntityValueResolver::supports() more specific #47339

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

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

I'm trying to make EntityValueResolver as specific as possible so that it resolves only arguments that are actual entities.

Would that make sense to you? (before I fix tests)

/cc @jderusse et al.

@jderusse
Copy link
Member

jderusse commented Aug 20, 2022

test case for the new unsupported cases is welcome

@@ -162,40 +169,55 @@ private function getIdentifier(Request $request, MapEntity $options, string $nam
}

if ($request->attributes->has($name)) {
return $request->attributes->get($name);
return $request->attributes->get($name) ?? ($options->stripNull ? false : null);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stof @jderusse would this added logic make sense to you, in relation with #47242?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me (with a test case 😉 )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test case updated

@nicolas-grekas nicolas-grekas merged commit d01ce28 into symfony:6.2 Aug 23, 2022
@fabpot fabpot deleted the db-evr branch August 23, 2022 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants