Skip to content

Conversation

@xavierlacot
Copy link
Contributor

@xavierlacot xavierlacot commented Oct 28, 2024

Q A
Branch? 3.4
Tickets
License MIT
Doc PR

When a ApiPlatform\Validator\Exception\ValidationException is created with a ConstraintViolationList and a $previous exception, the current constructor breaks on

parent::__construct($code ?? $this->__toString(), $previous ?? 0, $errorTitle instanceof \Throwable ? $errorTitle : null);

with the following error:

TypeError: Exception::__construct(): Argument #2 ($code) must be of type int, Exception given

@xavierlacot xavierlacot changed the title fix(valdator): allow to pass both a ConstraintViolationList and a previous exception fix(validator): allow to pass both a ConstraintViolationList and a previous exception Oct 28, 2024
Copy link
Member

@soyuka soyuka left a comment

Choose a reason for hiding this comment

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

Nice thanks!

@soyuka soyuka merged commit 736ca04 into api-platform:3.4 Oct 30, 2024
76 of 78 checks passed
@pyrech
Copy link
Contributor

pyrech commented Nov 15, 2024

Hi there :)

Will this fix be released in a 3.4 patch release? I see it was part of 4.0.7 release but did not see a 3.4.6 release. Is it intended?

@soyuka
Copy link
Member

soyuka commented Nov 15, 2024

3.4.6 took 2 weeks to release as we had another priority, it's released now

@pyrech
Copy link
Contributor

pyrech commented Nov 15, 2024

Awesome, thanks 💛 🎉

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.

3 participants