-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
5.4.0-BETA3 regression, Argument #2 ($haystack) must be of type array, null given #44182
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
Comments
Could this be caused by #44037, @nicolas-grekas? |
Just one other bit of information that might help is that it was not experienced in 5.4.0-BETA2 and only started with 5.4.0-BETA3 |
Can you provide some insights on which validation constraints are used by your form? Do you use any custom contraints? |
Some other comments about "groups" here #44138 (comment) and #44138 (comment) |
The contraints come from the User entity - there are only 2. /**
* @Assert\Length(
* min=8,
* max=4096,
* minMessage="The password is too short",
* groups={"Profile", "ResetPassword", "Registration", "ChangePassword"}
* )
*/
private $plainPassword;
/**
* @Assert\Email(
* message="The email '{{ value }}' is not a valid email.",
* mode="strict"
* )
* @ORM\Column(type="string", length=180, nullable=false)
*/
private $email; |
…when __sleep() is implemented (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [VarExporter] fix exporting declared but unset properties when __sleep() is implemented | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44138 Fix #44182 | License | MIT | Doc PR | - Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/44188/files?w=1). Commits ------- a557bdc [VarExporter] fix exporting declared but unset properties when __sleep() is implemented
Fixed by #44188 |
Thanks @nicolas-grekas - really appreciate your work. |
@nicolas-grekas I'm now seeing this issue on a 4.4 project, which I just updated to the latest release (4.4.34):
|
What is your version of symfony/var-exporter please? |
@bobvandevijver is this happening with a clean cache or do you have a cache created with the old version of Symfony ? |
I actually updated to the latest var-exporter (v4.4.34) as otherwise it spammed the following line:
But, somehow, the issue disappeared. I was sure I cleared the cache fully, but I guess I cleared the wrong one ( |
Thanks for the feedback, closing then. |
I am reproducing this issue on 5.4.0. I have deleted var/cache/* manually to no avail.
Here's my trace:
|
@amacrobert-meq As it looks to be tests for you as well, try to run |
Thanks but that didn't help (nor did deleting Making this change in /vendor/symfony/form/Extension/Validator/Constraints/FormValidator.php line 126 solves: foreach ($groups as $group) {
- if (\in_array($group, $constraint->groups)) {
+ if (\in_array($group, $constraint->groups ?? [])) {
$groupedConstraints[$group][] = $constraint;
...but I'm not sure if the real issue is caused upstream, and of course I don't want vendor patches in production. |
Alright I fixed in my app code. The EDIT: Better fix was to call the parent constructor. |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
5.4.0-BETA3
Description
Im really sorry I dont have a lot of information on why this is happening, but Im open and responsive if you have specific questions.
Normally, my app is totally exception free. After upgrading to Symfony 5.4 Beta3 I get this exception thrown when submitting a form that works fine in Symfony 5.3
Im hoping someone closer to the code might spot the regression from the stack trace.
The form is very basic with name, username, email and multiple submit buttons.
How to reproduce
Im really sorry I dont have a lot of information on why this is happening, but Im open and responsive if you have specific questions.
This also happens when users try to register with my app...
Possible Solution
No response
Additional Context
PHP 8.0.13
The text was updated successfully, but these errors were encountered: