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

Appearance settings

Pass validator.translation_domain to RequestPayloadValueResolver #58187

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
Sep 10, 2024
Merged

Pass validator.translation_domain to RequestPayloadValueResolver #58187

merged 1 commit into from
Sep 10, 2024

Conversation

raphael-geffroy
Copy link
Contributor

@raphael-geffroy raphael-geffroy commented Sep 5, 2024

Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #58170
License MIT

Replaces hardcoded validation translation domain by container param validator.translation_domain.
Used UploadValidatorExtension as inspiration.

@carsonbot carsonbot added this to the 7.2 milestone Sep 5, 2024
@raphael-geffroy raphael-geffroy changed the title fix: pass validator.translation_domain to RequestPayloadValueResolver [HttpKernel] fix: pass validator.translation_domain to RequestPayloadValueResolver Sep 5, 2024
@OskarStark OskarStark changed the title [HttpKernel] fix: pass validator.translation_domain to RequestPayloadValueResolver [HttpKernel] fix: pass validator.translation_domain to RequestPayloadValueResolver Sep 5, 2024
@OskarStark OskarStark modified the milestones: 7.2, 6.4 Sep 5, 2024
@OskarStark
Copy link
Contributor

Milestone 7.2 again per @xabbuh comment

@OskarStark OskarStark changed the title [HttpKernel] fix: pass validator.translation_domain to RequestPayloadValueResolver [HttpKernel] Pass validator.translation_domain to RequestPayloadValueResolver Sep 5, 2024
@OskarStark OskarStark added Feature and removed Bug labels Sep 5, 2024
@carsonbot carsonbot changed the title [HttpKernel] Pass validator.translation_domain to RequestPayloadValueResolver Pass validator.translation_domain to RequestPayloadValueResolver Sep 5, 2024
@@ -65,6 +65,7 @@ public function __construct(
private readonly SerializerInterface&DenormalizerInterface $serializer,
private readonly ?ValidatorInterface $validator = null,
private readonly ?TranslatorInterface $translator = null,
private ?string $translationDomain = null,
Copy link
Member

Choose a reason for hiding this comment

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

updated to

Suggested change
private ?string $translationDomain = null,
private string $translationDomain = 'validators',

@nicolas-grekas
Copy link
Member

Thank you @raphael-geffroy.

@nicolas-grekas nicolas-grekas merged commit a138360 into symfony:7.2 Sep 10, 2024
6 of 9 checks passed
@kbond
Copy link
Member

kbond commented Nov 12, 2024

If symfony/form isn't installed/available, you get the following exception:

Symfony\Component\DependencyInjection\Exception\RuntimeException: You have requested a non-existent parameter "validator.translation_domain".

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.

[HttpKernel] Hardcoded validation translation domain on RequestPayloadValueResolver
7 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.