Skip to content

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
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
@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